Forum

Thread tagged as: Question, Problem

Sitemap Question

I saw this thread https://forum.grabaperch.com/forum/08-05-2014-simple-sitemap-that-includes-blog-posts-and-list-and-detail-pages and the answer as well as https://solutions.grabaperch.com/html-and-css/how-do-i-create-a-google-sitemap

Should these be separate calls or could you place the call in the site map template inside the one for the general site e.g.

<url>
<loc>https://myurl.com<perch:blog id="postURL" /></loc>
<loc>https://myurl.com<perch:pages id="pagePath" /></loc>
</url>

And if the url for the blog is https://myurl.com/blog does the above work for this?

Nigel Coath

Nigel Coath 1 points

  • 7 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

I'm sorry I don't understand the question.

What do you mean by call?

Ignore the term not sure what to "call" it. Basically can I place both above urls inside one template or do there have to be essentially two separate xml files?

I mean the link inside the <loc>

Rachel Andrew

Rachel Andrew 394 points
Perch Support

No you need to do the pages, then the blog. Two PHP functions in the page and two templates. Not two xml files, just one then the other in the same file.

Okay thats what I thought, what about the path to blog, if its https://myurl.com/blog

is it:

<loc>https://myurl.com/blog<perch:blog id="postURL" /></loc>

or

<loc>https://myurl.com<perch:blog id="postURL" /></loc>
Rachel Andrew

Rachel Andrew 394 points
Perch Support

It should be:

<url>
    <loc>https://site.com<perch:blog id="postURL" /></loc>
</url>

However you can just try it and see. It won't cause any problems.

Okay thanks will do.