You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
According to Chat GPT, this code, inserted into
functions.php
for a Wordpress site, will clear the cache if I executehttps://mysite.com/?secret_purge=YOUR_SECRET_CODE
function custom_purge_wprocket() { if ( isset( $_GET['secret_purge'] ) && 'YOUR_SECRET_CODE' == $_GET['secret_purge'] ) { if ( function_exists( 'rocket_clean_domain' ) ) { rocket_clean_domain(); echo 'WP Rocket cache cleared!'; } else { echo 'WP Rocket is not activated.'; } exit; } } add_action( 'init', 'custom_purge_wprocket' );
Will that work?
Beta Was this translation helpful? Give feedback.
All reactions