How we integrate sitemap.xml?

Hello Friends,

I need sitemap in ‘http://domain.com/sitemap.xml’ so please give me idea how we implement in our website.

Thanks.

Hi @bhagvan.vrinsofts

The most straightforward way to gain the advantages of the sitemap.xml on your WordPress site is to use Frontity’s embedded mode, also see our SEO page for more info.

Also please take a look at this thread. There are also other threads that touch on this topic.

Hi @mburridge

Thanks for reply me.

I need sitemap in site URL not WordPress API URL.As per below example

API URL : http://www.testapi.com/wp-json
Site URL : http://www.test.com/sitemap.xml

Also i have used Frontity’s embedded mode but i need different urls for API and Site URL.

Thanks.

Hi @bhagvan.vrinsofts the solution of @mburridge is best and that is the way I also love it.

But in your case, if you have a different API URL, then in that case I have a solution for you.

Finding Issues?

Issue 1 :tired_face:
If we create a custom sitemap.xml file in the frontity level, you need to know node js and need to do a lot of work manually.

Issue 2 :pleading_face:
If we use WordPress’s sitemap like Yoast, but you have different API URLs, google search engine will not accept sitemaps from different domains or sub domain except your original domain.

Solutions :hugs:

If we have a different API URL and want to use WordPress’s generated sitemap like Yoast, we can use the robot.txt file to tell the search engine about our sitemap.

Here is an example, how this will look like

User-agent: *
Sitemap: https://apiurl.mydomain.in/sitemap_index.xml
Sitemap: https://apiurl.mydomain.in/category-sitemap.xml
Sitemap: https://apiurl.mydomain.in/post_tag-sitemap.xml
Sitemap: https://apiurl.mydomain.in/author-sitemap.xml
Sitemap: https://apiurl.mydomain.in/post-sitemap1.xml

I hope this will work for you. You may face another issue also, but this solution should work.