WordPress.org

Ready to get started?Download WordPress

Forums

Google News Sitemap Generator
Fix to not adding latest post to sitemap (2 posts)

  1. maorb
    Member
    Posted 3 years ago #

    I tried this plugin and noticed that when I publish a new post, there is a new sitemap file created, but it contains all relevant posts but not the most last post that was published.

    I checked this and noticed the problem is with an action call that is missing.

    In the google-news-sitemap.php file, at about line #213 there are these 4 lines -

    add_action('publish_post', 'write_google_news_sitemap');
    	add_action('save_post', 'write_google_news_sitemap');
    	add_action('delete_post', 'write_google_news_sitemap');
    	add_action('transition_post_status', 'write_google_news_sitemap',10, 3); //Future scheduled post action fix

    This line should be added to these -

    add_action('wp_insert_post', 'write_google_news_sitemap');

    After that, the last post will also be included in the google-news xml sitemap file.

  2. seanscullion
    Member
    Posted 2 years ago #

    Thank you 8^)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic