How to clear the cache?

I have made changes in my CSS, but it doesn’t work. I know it’s because of caching from admin panel.

How to clear cache of my WordPress admin. Is there any method to clear the cache?

Related posts

5 comments

  1. Have you looked at WP_Object_Cache?

    If you suspect there is unwanted caching happening in the code that generates the admin panel then you might be able to use functions from the WP_Object_Cache to clear it.

    WP_Object_Cache is WordPress’ class for caching data which may be
    computationally expensive to regenerate, such as the result of complex database queries.

    Try the function wp_cache_flush() which clears all cached data.

  2. I wonder why not you Googled and solved it first?

    Unlike Drupal, WordPress by default doesn’t have any Mass-Caching. The problem you are facing is well cited here:

    But for a quick check, open the wp-config.php (In the root of your WP installation, where there are three folders: wp-admin, wp-content, and wp-includes present) and check if 'WP_CACHE' is 'true'. Just make it 'false':

    define('WP_CACHE', 'false');
    

    Or, you can simply remove the line. (The WP_CACHE is better cited in this article.)

    If you are using any plugin for Caching, then the settings panel of the plugin will have a “Clear Cache” button. As per as I know, WP Super Cache Plugin has such button.

  3. <?php
    function wp_cache_flush() {
        global $wp_object_cache;
    
        return $wp_object_cache->flush();
    }
    
    ?>
    

    Create a new file say “flush.php” with above code in the root of your WordPress installation.

    Visit, yoursite.com/flush.php

  4. If you using cPanel for your site maybe you activate (or your hosting provider) Optimize WebSite option. Go to your cPanel and find “Optimize Website” page on Sowftware section.

    After that set”Compress Content” to disabled.

    Also if you changed your .htaccess file (this file located in your public_html folder) maybe you add any deflate or gzip code into. Change this file’s content to (please make backup before editing)

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress
    
  5. have you tried to clear from the admin panel using “Flush Cache” ? if not, please try it. the option is on the admin panel under “Managed WordPress”. See photo below. I hope this helps

Comments are closed.