WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. psaintq
    Member
    Posted 2 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,

    Philippe

    http://wordpress.org/extend/plugins/wordpress-seo/

  2. Joost de Valk
    Member
    Plugin Author

    Posted 2 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
    Member
    Plugin Author

    Posted 2 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
    Member
    Posted 1 year 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
    Member
    Posted 1 year 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

About this Topic