Monday, May 20, 2024

How to Fix Cloudflare missing admin bar issue on WordPress Websites?

Share

Cloudflare WordPress Plugin is the easiest way of setting up the Cloudflare CDN features for your WordPress websites or blogs. With the help of this plugin you can automatically purge the cache files, check the analytics and some additional features of CDN directly from the admin settings page. In the last release of their plugin version 3.1.1 they have moved Admin Bar behind Automatic Cache Purge toggle. This is causing some inconvenience to the users as they cannot see the admin bar once they visit the website pages.

If you have enabled the Jet pack statistics on admin bar, you also cannot use the feature anymore, as the Cloudflare plugin blocking the admin bar, so you can’t view the last 48 hours visitors statistics.

Here are the simple steps to get back the admin bar :

It is possible and very easy to hide or show the admin bar, just follow the below steps one by one..

  • STEP 1:
    Login to your cPanel and locate the file Hooks.php or alternatively you can trace the below path
    /home/<cpanel-path>public_html/wp-content/plugins/cloudflare/src/WordPress/Hooks.php
  • STEP 2:
    Now right click on Hooks.php and select Code edit and got to the editor and find the below lines of code for admin bar.
  • STEP 3
    Comment the two lines as below and save the changes and close the editor.
Now you will be able to see your admin bar back on your WordPress website. We have tested this also in WordPress Multisite Network and its worked fine..

NOTE: Commenting out the above lines may not work for all and can conflict with other plugins installed in your WordPress site. 

3 COMMENTS

Leave a Reply

Read more

More for you