Title: Pagination cache problem
Last modified: May 16, 2022

---

# Pagination cache problem

 *  Resolved [ricola771](https://wordpress.org/support/users/ricola771/)
 * (@ricola771)
 * [4 years ago](https://wordpress.org/support/topic/pagination-cache-problem/)
 * Hi,
 * This plugin has helped the speed metrics of my site greatly! I have one small
   issue yet to resolve: It only caches the home page and not any paginations under
   it. For example, [https://example.com/page/2/](https://example.com/page/2/) will
   be cached forever and the content will never be updated after adding new posts.
 * This has been mentioned before here: [https://wordpress.org/support/topic/how-to-solve-the-pagination-cache-problem/](https://wordpress.org/support/topic/how-to-solve-the-pagination-cache-problem/).
   
   Such post discusses a workaround adding some code using swcfpc_post_related_url_init.
 * Can you please share it? I’m not an experienced coder.
 * So far, the only solution I’ve found is to disable the plugin before adding a
   new post and then enabling it again.
 * My settings:
    -I have the homepage to display latest posts. -Using theme foodica
   lite. Can be downloaded at: [https://themes.trac.wordpress.org/browser/foodica/1.1.1?rev=131332](https://themes.trac.wordpress.org/browser/foodica/1.1.1?rev=131332)
 * Please let me know if you need more information. Thanks a lot for your support
   and the work behind this plugin!

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

 *  Plugin Contributor [iSaumya](https://wordpress.org/support/users/isaumya/)
 * (@isaumya)
 * [4 years ago](https://wordpress.org/support/topic/pagination-cache-problem/#post-15651672)
 * Hi,
    The home page paginations are not considered by the plugin but as you stated
   you can use the `swcfpc_post_related_url_init` filter to add extra URLs that 
   will be considered under the list of related URLs.
 * For example you can add the following code in your `functions.php` file:
 *     ```
       add_filter( 'swcfpc_post_related_url_init', function($listofurls) {
       	return array_merge(
       		$listofurls,
       		[
       			'https://example.com/page/2/',
       			'https://example.com/page/3/',
       			'https://example.com/page/4/',
       			'https://example.com/page/5/',
       			'https://example.com/page/6/',
       			'https://example.com/page/7/',
       			'https://example.com/page/8/',
       			'https://example.com/page/9/',
       			'https://example.com/page/10/'
       		]
       	);
       } );
       ```
   
 * Make sure you replace the URLs with actual URLs.
    Hope this helps.
 *  Thread Starter [ricola771](https://wordpress.org/support/users/ricola771/)
 * (@ricola771)
 * [4 years ago](https://wordpress.org/support/topic/pagination-cache-problem/#post-15661262)
 * Thank you so much for your help Saumya! Issue has been solved.
 * Can this code be future proofed? For instance, adding 50 pages to the code even
   though I currently have 20? Will this create a problem with the plugin?
 * I ask this because once my page is full (12 posts) I will have to add a non existing
   page to the code before creating a new post.
 * Cheers
 *  Plugin Contributor [iSaumya](https://wordpress.org/support/users/isaumya/)
 * (@isaumya)
 * [4 years ago](https://wordpress.org/support/topic/pagination-cache-problem/#post-15661439)
 * Well, I honestly don’t think you will need to add more than 10 pages for pagination.
   As no real user will go that deep on the pagination. So, if you old pagination
   pages are not updated, it’s fine.
 *  Thread Starter [ricola771](https://wordpress.org/support/users/ricola771/)
 * (@ricola771)
 * [4 years ago](https://wordpress.org/support/topic/pagination-cache-problem/#post-15661515)
 * Makes sense. Thanks!
 *  Thread Starter [ricola771](https://wordpress.org/support/users/ricola771/)
 * (@ricola771)
 * [4 years ago](https://wordpress.org/support/topic/pagination-cache-problem/#post-15661696)
 * Saumuya, I just noticed that the categories URLS autoupdate but not the tags 
   URLS.
 * Is there a way to fix this without adding each tag page to the code above?
 * Thanks,
 *  Plugin Contributor [iSaumya](https://wordpress.org/support/users/isaumya/)
 * (@isaumya)
 * [4 years ago](https://wordpress.org/support/topic/pagination-cache-problem/#post-15662838)
 * From what I see in the code, all post taxonomies i.e. both catory and tags should
   get auto purges as it is considered under related items.

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

The topic ‘Pagination cache problem’ is closed to new replies.

 * ![](https://ps.w.org/wp-cloudflare-page-cache/assets/icon-256x256.gif?rev=3234997)
 * [Super Page Cache – Cloudflare Cache, Page Speed & Core Web Vitals](https://wordpress.org/plugins/wp-cloudflare-page-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-cloudflare-page-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-cloudflare-page-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-cloudflare-page-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-cloudflare-page-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-cloudflare-page-cache/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [iSaumya](https://wordpress.org/support/users/isaumya/)
 * Last activity: [4 years ago](https://wordpress.org/support/topic/pagination-cache-problem/#post-15662838)
 * Status: resolved