suggest : auto update all posts after importing settings

  • Hello,

    Thanks for this fabulous plugin !!!

    an idea, would be to add a flush fonction after importing data.
    i just migrate a big database site to rank math & everything works well, except that all the posts have to be update before rank math dashboard could be filed.

    For 1500 posts, it is a bit long to do.

    So i’ve wrote a little function to update all posts (in functions.php)

    function update_all_posts() {
        $args = array(
            'post_type' => 'post',
            'numberposts' => -1
        $all_posts = get_posts($args);
        foreach ($all_posts as $single_post){
            $single_post->post_title = $single_post->post_title.'';
            wp_update_post( $single_post );
    add_action( 'wp_loaded', 'update_all_posts' );

    But i think, it would be more easyer that after the import, you add an option to do it manually for non developper users 😀

    Long live to Rank math !

Viewing 2 replies - 1 through 2 (of 2 total)
  • Just see that some similar request was already on the forum, with a solution similar !

    so maybe you will implement this on next version 🙂


    Thank you for your message and for sharing the code snippet.

    The issue with not providing an option or to auto-update the older posts is because how Google expects the updated articles to show.

    When an article is updated, Google would expect some changes in the content. Otherwise, it might limit the number of posts crawled or maybe penalize a site assuming it’s trying to manipulate the search engines by showing the last updated date.

    In either case, we do not want to take that risk and do not recommend anyone to update their posts just to reflect the scores.

    Also, please do not obsess over the scores. These are just for guidelines. These are not a set of rules one have to adhere to. With that said, I can understand that having it update automatically for your entire post archive would be helpful but it is impossible (nearly) to do the way we are handling tests.

    Hope that helps. If you have any further question(s), please let us know.

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this ticket.