How to deny access to themes and plugins edit page

Sometimes, it is enough just to hide a link from the admin menu and thus, deny access to a specific edit page. But if you only hide a certain link, the page which the link leads to will still be accessible to anyone who knows the correct path to the file. Since many users will stay with the default setup, it is easy to find that path.

Consider hiding the menu link only if you want to make the menu less crowded and simply exclude the possibility of accidental access to the pages.

When it comes to admin access, probably the most damage can come from file editor which is by default included for all themes and plugins. While the editor is a great tool which can help you quickly view core files and functions and even make some minor changes to the code, it can be a tool of destruction if left for unexperienced users. Only one wrongly placed character can take down your entire site so this is definitely something not to mess with.

Because editors in WordPress are quite sensitive to changes, it is best to completely remove them for users. In this article, we’re about to show you a very simple method of removing pages, as well links to those pages.

IMPORTANT NOTICE: Before you proceed with making changes to your functions.php file, you should know that disabling editor pages might make your themes or plugins out of order. This depends on each theme and plugin itself, so be sure to check your theme and plugins to see if everything is working correctly.

Now that you’re aware of the risk, you can continue with implementing the code.

Deny access to Themes and Plugins edit page:

  1. Open functions.php file from your editor for the last time
  2. Copy and paste the code:
  3. define('DISALLOW_FILE_EDIT',true);
  4. Save changes
  5. Don’t freak out about the message – you have just restricted yourself from accessing the editor.
  6. Simply navigate back to your site admin and notice how links to editors have disappeared

Now you have successfully removed Theme and Plugin edit page which can’t be accessed through WordPress anymore. In order to change those files, you will have to use a different approach and use an FTP client, for example.

If you need further customization, you can easily hide a plugin from the list.

START YOUR OWN BLOG

This guide is an introduction to mastering the art of blogging. It provides easy to follow steps to start, maintain, and grow your blog.

Read the guide

Leave a Reply

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