Remove the NGINX Helper “Purge Cache” link from Admin Bar

by | May 6, 2015 | WordPress Tweaks

The Nginx Helper is a nice little plugin if you’re running Nginx on your server. However, it adds a “Purge Cache” link to your admin bar which you may not necessarily use a lot. And if you’re running in tandem with W3 Total Cache or WP Super Cache with the Clear all cache admin bar option, this second Purge Cache link could get a little confusing.

To remove it, simply add the following code to either a custom plugin (perhaps in mu-plugins) or your theme’s functions.php file:

[fancy_code_box]

function nginx_admin_bar_remove_link() {
global $rtwpAdminPanel;
remove_action( ‘admin_bar_menu’, array($rtwpAdminPanel, ‘nginx_toolbar_purge_item’), 100 );
}
add_action( ‘admin_head’, ‘nginx_admin_bar_remove_link’ );

[/fancy_code_box]

 

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Notify me of followup comments via e-mail. You can also subscribe without commenting.