Hide GravityKit WordPress Admin Backend Menu

, , ,

To hide the GravityKit menu link from the WordPress Admin Backend menu without having to mess with the GravityView Access Capabilities, you can use the filter provided below. Note this will hide the GravityKit menu for all users except administrators:

if( ! current_user_can( 'administrator' ) )
{
  add_filter( 'gk/foundation/admin-menu/submenus', function ()
  {
    return [];
  }, 100 );
}

To hide the menu for everyone, including yourself (administrators) use the code below:

add_filter( 'gk/foundation/admin-menu/submenus', function ()
{
  return [];
}, 100 );

Adding a WordPress Filter to your Website

You can add one of the above filters to your WordPress website using the built in theme editor.

To access this editor hover over the Appearance menu on the left of your admin backend and click Theme File Editor from the drop down menu that appears.

Next, click on the link named Theme Functions (functions.php) under the section titled Theme Files on the right side of your screen.

You can now inject one of the filters provided above into the theme file editor window and click the Update File button at the bottom to save.

Reminder to be careful! If you’ve entered the code in incorrectly it may result into breaking your site. Better to first ensure you have a working backup and or having tried this edit on a staging site to confirm desired operation. And as always, never hesitate to ask for help!

 

Conclusion

I hope my article on hiding the GravityKit WordPress Admin Backend Menu has helped you. I welcome your thoughts, questions or suggestions regarding this article.

You may support my work and future improvements by sending me a tip using your Brave browser or by sending me a one time donation using your credit card.

Let me know if you found any errors within my article or if I may further assist you by answering any additional questions you may have.