Support » Plugin: Yoast SEO » [Plugin: WordPress SEO by Yoast] How to add a non WordPress page to the sitemap?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Joost de Valk

    (@joostdevalk)

    Not right now. There’s nothing wrong with adding a second XML sitemap in your google webmaster tools though.

    Plugin Author Joost de Valk

    (@joostdevalk)

    I went ahead an added a filter, allowing you to do this for the next version. Write a function as follows:

    function wpseo_add_page_to_xml_sitemap( $content ) {
    	global $wpseo_sitemaps;
    
    	$url = array(
    		'loc' => 'http://example.com/example.html',
    		'pri' => '0.8',
    		'chf' => 'weekly',
    		'mod' => date('Y-m-d H:i:s', filemtime('/home/example/public_html/example.html') )
    	);
    	$content .= $wpseo_sitemaps->sitemap_url( $url );
    	return $content;
    }
    add_filter( 'wpseo_sitemap_page_content', 'wpseo_add_page_to_xml_sitemap' );

    did you ever get this completely resolved with the function and where should I add this function? and obviously replacing example.com/example.html with my page?

    also can I change the default priority of posts the something else? like instead of 0.6 make it 0.4 and leave pages at 0.8

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: WordPress SEO by Yoast] How to add a non WordPress page to the sitemap?’ is closed to new replies.