With a WPCMS site, some pages are "special" pages - order return pages and error pages for example - which you might not want included in a sitemap. Likewise, some sites have a page which has a lot of additional content based on the variables supplied (an example of this is the Dog and Lemon Guide's Japanese Vehicle Recall database, which lists recalls affecting 46,000,000 vehicles from 21 car companies).
Arne Brachhold's Google Sitemaps plugin for WP offers a hook which allows you to add a number of additional pages when the sitemap is built, which is a marvellous thing. And with a small tweak to look for a custom field value named "sm_exclude" (for sitemap exclude), we can ensure that those special pages which Google shouldn't send people straight to are excluded.
Here are a few snippets from this morning's work:
Arne, if you're happy to incorporate these changes then I can remove the ZIP from here and redirect people to your site for the updated version.
I don't know of any WP robots.txt plugins that allow for an exclusion option per-page, but if they exist, this code could also check for those to avoid folks having to duplicate a set of per-page options.
And Arne, thanks for a great plugin!
Comments
Post new comment