Site logo

Archived topic

How to hide GP Premium functionality in the admin panel?

13 replies · Started by Mihail on January 20, 2022

Viewing posts 1–14 of 14

Hi all!

Can you tell me how to hide the settings of premium, and everything related to this plugin in the admin area of the site?

The thing is, I don't want the person I'm making the site to have access to all of the GP Premium features, as well as my license key.
Thx :)

Hi. I think you don't quite know what I mean.

I want to hide the plugin NOT for any groups of users, but from all. Including myself.

Meaning. I am making a site for a client. And I don't want him to know that I used the GP Premium plugin.
After the work is done from my side, I want to completely hide from everyone the presence of the plugin in the admin panel.

Once upon a time I found something like this. Some code was written in functions.php, but I can not find it :(

I want to hide GeneratePress premium options in the admin panel. Specifically, right here:
https://c.radikal.ru/c17/2201/ec/84e792b885f5.png

At a minimum, I need to hide the license key field.

Ideally, I'd also like to hide the module fields.

I get what you mean but I didn't get the full details of the extent of how or what should be disabled. I assumed you only want to disable it for normal users EXCEPT for Super admin.

You're aiming to completely remove the access of GP Premium for ALL ROLES once you're done with the development. But removing Admin accounts' privileges means locking it and throwing out the key for good.

But to answer the question:

You can get any role editor plugins and remove the edit_theme_options privileges for the Administrator role as well.

But be warned, this means no one will be able to make any changes anymore as even an Admin account effectively can't do anything about it as well. (meaning if the client hires a new developer to modify things, it will be an issue)

Hi there,

Yes, that code has changed with the Dashboard re-design.

Try this:

add_action( 'after_setup_theme', function() {
    remove_action( 'admin_menu', array( 'GeneratePress_Dashboard', 'add_menu_item' ) );
} );

Let me know :)

Hi, Tom!
https://c.radikal.ru/c15/2201/08/a6f0779d0f41.png
Do I understand correctly that this code:

add_action( 'after_setup_theme', function() {
    remove_action( 'admin_menu', array( 'GeneratePress_Dashboard', 'add_menu_item' ) );
} );

should be inserted at the end of functions.php? If so, nothing happened :(

was (without code):
https://a.radikal.ru/a34/2201/c1/19f3d642c017.png

became (with code):
https://a.radikal.ru/a13/2201/a1/4c3635a975f3.png

I don't see any difference. Unfortunately...

Try this instead:

add_action( 'wp', function() {
    remove_action( 'admin_menu', array( 'GeneratePress_Dashboard', 'add_menu_item' ) );
} );

Nothing...

I changed the site language to English and once again add login, pass.

I did this so you can see for yourself and test. Try it.

Let's give this a shot, instead:

add_action( 'admin_init', function() {
    remove_submenu_page( 'themes.php', 'generate-options' );
} );

Let us know :)

Yes, yes, yes.

add_action( 'admin_init', function() {
    remove_submenu_page( 'themes.php', 'generate-options' );
} );

It works! And that's what it takes :)
Thank you.

Tom, David - you are the coolest! 🤘

Glad we could help! :)

This archived topic is closed to new replies.