I have installed sitmap module to create sitemap.xml file.
Now I want to add some custom element like
<expires>2010-10-10</expires>
for some URLS.
I have installed sitmap module to create sitemap.xml file.
Now I want to add some custom element like
<expires>2010-10-10</expires>
for some URLS.
If you don't mind a programmatic approach, then follow these steps:
Create/use a custom module (say, MYMODULE) & use the following hook:
function MYMODULE_xmlsitemap_element_alter(&$element, $link, $sitemap) {
// Some logic to generate datetime
// or hardcoded value
$element['expires'] = '2010-10-10';
}
Hope this helps.
The expires tag is not valid Sitemaps.org Protocol - http://www.sitemaps.org/protocol.html
You can configure the overall sitemap lifetime on this page: /admin/config/search/xmlsitemap/settings
Set it the Minimum sitemap lifetime to "1 Day" and make sure your nodes are unpublished when you want them to expire, either manually or using a module like Scheduler, and they will be removed from the sitemap.xml