Star Point 9Star Point 9
  • Home
  • About
  • Articles
  • Shop
    • My Login
    • My Account
    • My Cart
    • Shop > Clothing
    • Shop > Home & Living
  • Pages
    • Appointments
    • Portfolio
    • Success Stories
    • Web Hosting & Domains
  • Contact Us
Back
  • Home
  • About
  • Articles
  • Shop
    • My Login
    • My Account
    • My Cart
    • Shop > Clothing
    • Shop > Home & Living
  • Pages
    • Appointments
    • Portfolio
    • Success Stories
    • Web Hosting & Domains
  • Contact Us
  • Home
  • Articles
  • Technology
  • Remove WordPress Admin Bar from Page Cache

Technology

14 Oct

Remove WordPress Admin Bar from Page Cache

  • By Steven North
  • In Technology, WordPress
Remove WordPress Admin bar from Page Cache

I've been working with WordPress since I heard about this concept called 'Moveable Type' many years ago, then I went from building my own website to being employed to work for others. Today, working on wordpress websites is what I'm doing on an almost daily basis. One of the things that I dived into was speed & security but one thing I noticed when working on my own website was how the Admin Bar in wordpress would show up on cached page views, something wasn't correct. I thought it was an issue with Cloudflare or caching rules but it turns out to be something much simpler.

Remove WordPress Admin bar from Page Cache

 

All WordPress websites have the wp-admin toolbar.

To improve my own website performance, I used an incredible caching plugin called Swift Performance Pro, as can be seen in the image above.  I also use the free version of WP Fastest Cache if I get stuck. So, when the cache view is being generated, I visit the website, the WP-Admin toolbar shows up, with the admin user logged in. Well, to me, this isn't a good thing at all but even with specific rules in Cloudflare to not cache /wp-admin/ folder, it would still show up, thanks to the WordPress community, I figured out what was happening.

Exclude the Admin Bar

Now there are a few ways to exclude the admin bar from being cached and if you are caching a website, chances are, you're merging CSS & JS files but we want to exclude a specific file from being merged within the CSS files and this file is called admin-bar.min.css and can be located in /wp-includes/css/ folder.

To achieve this, what we want to do is to exclude a specific file from being cached and/or being merged. So how did I do it?

In the WP Fastest Cache settings, you can choose to exclude specific CSS files from being included in the cache, all you need to do is navigate to the 'exclude' tab in the plugin settings and add 'admin-bar.min.css' in the exclude section, as can be seen in the screenshot below. This turned out to be the fix that I needed.

In Swift Performance, you need to navigate to Settings > Optimization > Styles and in the 'Exclude Styles' settings, add the admin-bar.min.css to this section. This should be visible in the Simple & Advanced View. You can see a quick view in the image below.

 

Remove WordPress Admin Bar from Page Cache 1

WP Fastest Cache

Remove WordPress Admin bar from Page Cache

Swift Performance

Both methods have been working for me nicely and I'm very grateful that they are working, more so since I run all sites that I manage with Cloudflare's CDN and have had troubles in the past trying to figure out why the wp-admin bar kept showing up.

It was because I found an article by Russel Random on Stackpath, which is another CDN service that answered the question as to why the WordPress Admin Bar was showing up in cached sites using their CDN, how to purge it from their cache systems and other methods on how to prevent the admin bar from being cached...

Finally, if you do want to get your hands on a copy of Swift Performance, it is one incredible plugin for WordPress and the developers are not only supportive but beyond helpful. You can CLICK HERE to view the software. It has been one of the greatest pieces of software I've purchased.

If you're in need of assistance with WordPress or your website, connect with Steven North at Star Point 9 or CLICK HERE.

    Tags:SoftwareWebsitesWordPress
    • Share:
    Steven North
    Steven North is the founder/owner & operator of Star Point 9. His wide diverse array of knowledge & experience can provide both individuals and businesses with knowledge, advice & support.

    Follow Us

    Search the Site

    Categories

    • Business (6)
    • Client Projects (2)
    • Health & Wellness (5)
    • Podcast (1)
    • Social Groups (1)
    • Technology (1)
    • Videos (1)
    • WordPress (1)

    Recent Posts

    BizWeb Consulting & Domain Names
    BizWeb Consulting & Domain Names
    17Nov,2021
    BizWeb Consulting & Restructuring
    BizWeb Consulting & Business Restructuring
    08Nov,2021
    Kings of the Sun, Fremantle WA - Advertising & Marketing
    Kings of the Sun, Fremantle WA – Advertising Campaigns
    17Sep,2021

    Tags

    Advertising BizWeb Consulting Business Business Services Business Systems Consciousness Copyright Heart Activation Music Hosting Marketing Mental Health News & Updates Perth Business & Spiritual Network Podcast Social Groups Software Sound Healing Star Point 9 Steven North Video Vivacious Living Centre Websites Website Services WordPress

    Check Out the Shop

    A variety of products is available in the store. From clothing designs, crystals and much more.

    Star Point 9 provides business services and helps people with the understanding of mindfulness and consciousness through workshops, events and seminars

    Useful Links

    • About Us
    • Articles
    • Success Stories
    • Privacy policy
    • Shop
    • My Account
    • Cookie Policy (AU)
    • Contact

    GET IN TOUCH

    +618 6556 6690

    Star Point 9

    Vivacious Living Centre
    9 Risely Street
    Ardross, WA, 6153, AU.

    Our Office Location

    Star Point 9 website managed by BizWeb Consulting - Powered by C8H10N4O2 - Copyright © 2016+, Star Point 9