The swcfpc=1
parameter you’re seeing in your URLs is a cache buster added by the Super Page Cache for Cloudflare plugin. This parameter ensures that logged-in users see the most current version of the page, bypassing any cached versions. This only applies to logged-in users, and normal visitors to your site will receive the cached version for faster load times.
However, if you’re concerned about duplicate content issues due to this parameter, there is a way to manage this. This guide shows how to remove this query parameter using Cache Rules in Cloudflare:
Please replace example.com
with your actual website hostname in the code below before implementing.
Note: The guide is assuming that you’re comfortable with adding custom rules in your Cloudflare dashboard. It’s meant for advanced users and some rules can only be implemented by Cloudflare Business and Enterprise account users.
- Log-in to your Cloudflare dashboard and go to the domain/zone for which you are setting up the Super Page Cache for Cloudflare plugin.
- From the left-hand side menus, go to
Caching > Cache Rules
. - Inside the Cache Rules page, click on the
Create Cache Rule
button. - Then on the Create new Cache Rule page, click on the
Edit Expression
link. - Add the necessary rules. There are multiple rules outlined in the guide. Here are the first three:
Rule 1 – Cache Bypass — WP Admin Paths, WooCommerce API, EDD API Endpoints
lua
(
http.host eq "example.com" and
(starts_with(http.request.uri.path, "/wp-admin") or starts_with(http.request.uri.path, "/wc-api/") or starts_with(http.request.uri.path, "/edd-api/"))
)
Rule 2 – Cache Bypass — XML, XSL & PHP Files
lua
(
http.host eq "example.com" and
(http.request.uri.path contains ".xsl" or http.request.uri.path contains ".xml" or http.request.uri.path contains ".php")
)
Rule 3 – Cache Bypass — Default Bypass Cookies
sql
( http.host eq "example.com" and (http.cookie contains "wordpress_logged_in_" or http.cookie contains "comment_" or http.cookie contains "woocommerce_" or http.cookie contains "wordpressuser_" or http.cookie contains "wordpresspass_" or http.cookie contains "wordpress_sec_" or http.cookie contains "yith_wcwl_products" or http.cookie contains "edd_items_in_cart" or http.cookie contains "it_exchange_session_" or http.cookie contains "comment_author" or http.cookie contains "dshack_level" or http.cookie contains "auth_" or http.cookie contains "noaffiliate_" or http.cookie contains "mp_session" or http.cookie contains "xf_" or http.cookie contains "mp_globalcart_") and not http.request.uri.path contains "." )
For each rule, set the Cache Status to Bypass Cache.- Optional Rule 4 for Cache Eligible Requests & Ignore Unnecessary Query Params from cacheKey is also provided in the guide.
- After adding all these Cache Rules, enable the
Remove Cache Buster Query Parameter
option in the Super Page Cache for Cloudflare plugin settings and save. - Finally, purge everything from the Cloudflare Cache.
This guide has outlined the necessary steps to configure the Cloudflare caching system and plugin to remove the cache buster query parameter from your URLs. By following these steps, you should prevent any potential duplicate content issues caused by the swcfpc=1
parameter.