Tip: Hiding the WP Migrate DB Pro Menu Item

Every now and again we have a customer ask us if it’s possible to hide the “Migrate DB Pro” menu item from the WordPress dashboard. As a result we’ve decided to bake this functionality into our tweaks plugin.

If you haven’t read up on the tweaks plugin you can do so in this blog post.

Why hide the menu item?

It is rarely the case that a client would ever need access to WP Migrate DB Pro. And having that menu item could add confusion for your client. They might wonder what it is and even start poking around. They could mess with the security settings, reset your API key, or even┬áreplace the entire database if they run a push from another site. WP Migrate DB Pro is intended for developers and should only be used by those who understand what they’re doing.

You could just deactivate and uninstall the plugin on the live site. But as a developer, you usually still want to it active on the site so you can pull down the latest data when the need arises. Another solution here is to simply hide the menu item.

How does it work?

  • Download and install the WP Migrate DB Pro tweaks plugin
  • Uncomment line 46, i.e. change:
    //add_filter( 'admin_menu', array( $this, 'remove_menu_item' ) );
    to this:
    add_filter( 'admin_menu', array( $this, 'remove_menu_item' ) );
  • Save the file

How do I access the page now?

This method only hides the menu item, you can still access the plugin page directly by navigating to the following URL:
http://your-website.com/wp-admin/tools.php?page=wp-migrate-db-pro

Of course, you could also use this as sample code and add it to your theme or one of your plugins. And even add an if statement to only remove the menu item when it’s not you that’s logged in.

As usual, we love to hear your feedback! Please let us know in the comment section below if you have any question about the above or really anything WP Migrate DB Pro related.

About the Author

Chris Aprea

Chris wrote a ton of code and helped lots of customers for Delicious Brains during his 2-year stint with us. He has since moved on to other things.

  • mrjupave

    Very kind of you guys to create a fix for this, though if anybody cares about further admin menu customization I highly recommend Admin Menu Editor (http://wordpress.org/plugins/admin-menu-editor/). Great for hiding or adding new items, resorting, etc.

    My method: Since I’m primarily a freelancer and might get hit by a bus one day, what I often do in Admin Menu Editor is put everything the client need at the top of the sidebar, then add an “opacity: .2” style to everything else (Tools, Appearance, WP Migrate DB Pro, etc.) so they’re still accessible, but it subtly tells the client, “you really don’t need to click these.”