Yoast SEO
[resolved] [Plugin: WordPress SEO by Yoast] How to add a non WordPress page to the sitemap? (5 posts)

  1. psaintq
    Posted 4 years ago #

    Hi Support!

    I have KML file in the html root directory(http://applefix.com.au/location.kml) which I would like to add to my sitemap. Is there anyway I can do that in the WordPress SEO Plugin?

    Many thanks,



  2. Joost de Valk
    Plugin Author

    Posted 4 years ago #

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

  3. Joost de Valk
    Plugin Author

    Posted 4 years ago #

    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' );
  4. jram32
    Posted 3 years ago #

    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?

  5. jram32
    Posted 3 years ago #

    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

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Yoast SEO
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic