Support » Plugin: Slim SEO - Fast & Automated WordPress SEO Plugin » Select Number of “Posts Per Page” in Sitemap

  • Resolved slangs


    I like almost everything about Slim SEO, but it’s missing the ability to choose the Number of Posts per Page in the Sitemap, as sites with thousands of posts can hit performance issues dynamically generating 1K per page.

    I was experiencing PHP slowdowns in a 8GB/4CPU/8MB/s mid-range hosting package on a large site, so I edited the PostType.php file from 2000 to 200 and everything went back to normal. The only problem is that I have to quickly edit the file after each update.

    Other SEO plugins like Rank Math and Yoast offer the ability to select “posts_per_page” sitemap option through the UI, and these stay resident after updates – is there any possibility of this feature finding its way into Slim SEO?


    • This topic was modified 4 months, 1 week ago by slangs.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Anh Tran


    Hi @slango,

    Yes, it’s possible to so with this snippet:

    add_filter( 'slim_seo_sitemap_post_type_query_args', function( $query_args ) {
        // Change number of URLs
        $query_args['posts_per_page'] = 200;
        return $query_args;
    } );

    You can add this snippet into your theme’s functions.php file or use the plugin Code Snippet to run it.

    Thread Starter slangs


    Thanks, and as stated I know all the workarounds and am using one right now to lower the Sitemap to 200 posts per page, but the actual question was:

    Is there any possibility of this “posts_per_page” setting being added to the Slim SEO UI, like it is in Rank Math and Yoast?

    Plugin Author Anh Tran


    Ah, I see. The goal of the plugin is keeping the UI as clean as possible. I’ll consider about that.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.