How to Hide Divi Booster in the WordPress Admin
Divi Booster adds the CSS, JS, and PHP code it generates to the theme on the fly, to save modifying the core theme files and potentially damaging them. This means that if you disable or uninstall Divi Booster all its effects are lost (until you re-enable it, at least). Sometimes you may want to hide the presence of Divi Booster (e.g. to stop a client accidentally making changes), but keep it running. One way is to hide it with CSS (added into the admin area using PHP).
While not perfect, this code will do quite an effective job of hiding Divi Booster from the plugin page and the WordPress admin menu.
add_action('admin_head', 'hide_divi_booster');
function hide_divi_booster() { ?>
<style>
a[href="themes.php?page=wtfdivi_settings"],
a[href="admin.php?page=wtfdivi_settings"],
table.plugins #divi-booster,
tr[data-slug="divi-booster"] {
display:none !important;
}
</style>
<?php
}
Related Post: Adding PHP to the Divi Theme
Want get more out of Divi?
Hundreds of new features for Divi
in one easy-to-use plugin
Hi Dan-
I tried this and it didn't seem to work at all. Then I looked at the code and realized that I don't know what this is:
a[href="themes.php?page=wtfdivi_settings"]
it looks like html combined with a shortcode… Googling hasn't helped me understand it either.
I'd tell you it's a typo but the [ ] at both ends make me think otherwise. If you could explain it I'd appreciate it.
Thanks-
Hey Jeff, that's a CSS attribute selector. They let you apply CSS to HTML elements based on the element's attributes, in this case the value of the link's href. So that CSS matches any links pointing to the Divi Booster settings page.
Sorry, the code was a bit out of date. I've just revised it so it should now work correctly. I've also wrapped it in the PHP code needed to apply the CSS to the admin area (as the likes of Divi's custom CSS box doesn't affect the admin area).
Cheers!
Dan