Problem Enabling External Page Sitemap
-
I am trying to add a subdirectory of non-wordpress pagesto the sitemap. They are generated dynaically in /docs and cached copies exist at /docs-cache I do all this vis a plugin. I am scraping another site to get this info. All the pages render fine but I can’t get the BWP Sitemap to show these pages. I have implemented the following hook like so:
…`
add_filter(‘bwp_gxs_external_pages’, ‘starquestDocSync::integrate_sitemap’);
…
static function integrate_sitemap()
{
$html = file_get_html(‘https://docs.starquest.com/sitemap.shtml’);
$i=0;
$sitemap_locations = Array();while($html->find(‘a’, $i) !== null)
{
$href = $html->find(‘a’, $i)->href;if(stristr($href, ‘docs.starquest.com’) !== false) {
$href = str_replace(‘docs.starquest.com’, self::$base_url . ‘/docs’, $href);$sitemap_locations[] = Array(
‘location’ => $href,
‘lastmod’ => date(‘c’),
‘frequency’ => ‘auto’,
‘priority’ => ‘1.0’
);
}
}return $sitemap_locations;
}`I have also checked the “Enable External Sitemaps” on the wp admin console. Yet no evidence of these files shows up. In the sitemap log the following message appears:
Requested sitemap (page_external.xml) was not found or not enabled.
Does this mean I have to add a module for the external sitemaps? I dont need db access to generate them, and I’d prefer to keep the code in my plugin. Is there something I’ve missed?
The topic ‘Problem Enabling External Page Sitemap’ is closed to new replies.