I am trying to access the theme editor in WordPress.
The problem is that I cannot find the option under Admin-Appearances - Editor and when I try to access the page using the link I get the error:
You do not have sufficient permissions to access this page.
I am logged in as an administrator. Why can't I find the editor option?
10 Answers
It is probably because of iThemes Security and its settings. So yeah, just go to wp-config and change DISALLOW_FILE_EDIT to false.
define( 'DISALLOW_FILE_EDIT', false );Or just switch it off here:Dashboard -> Security -> WordPress Tweaks -> Configure Settings
Uncheck: Disable File Editor
2Open up your wp-config.php file, and search for
define('DISALLOW_FILE_EDIT', true);Change true to false:
define('DISALLOW_FILE_EDIT', false); 0 For those who are using Siteground hosting define('DISALLOW_FILE_EDIT', false); won't work. Sitegound hosting provide SG Security plugin by default on direct WordPress installation from cPanel and it blocks the Theme Editor and Plugin Editor option by default.
To enable the Theme Editor and Plugin Editor option you just need to disable the option called Disable Themes & Plugins Editor under Site Security. Here is the path to disable that option :
Click on SG Security -> Site Security -> Disable Themes & Plugins Editor Option
That's it. I hope you find it useful.
2At root directory of your wordpress. Open up your wp-config.php file, and search for
define('DISALLOW_FILE_EDIT', true);Change true to false:
define('DISALLOW_FILE_EDIT', false); To enable the theme editor, follow these steps:
- Go to Appearance, select one theme (any one you like) and activate it.
- In this activated theme, go to Appearance → Editor → select the theme to edit (on the top right, above Templates. There is a drop-down click on it and select your previous theme.)
- Now select config.php or demo config.php and remove the define ( 'DISALLOW_FILE_EDIT, true); code.
- Now click on Update file.
- Now change the theme to your previous theme.
Now you can find your editor in the Appearance drop-down.
2The Sucuri WordPress plugin will also disable the editor in its settings under the "Hardening" tab. You can click on Revert Hardening, make your changes, and then go back and apply hardening when you're finished.
Hack:
Manually browse:
1Remove both codes define('DISALLOW_FILE_EDIT', false); define('DISALLOW_FILE_MODS', true);
After this just refresh, the dashboard Theme editor will appear.
It is also possible that it is being blocked by a security plugin or the like. In my case SG security (from siteground) had an option active that deactivated the editor.
If you used Siteground host.. you can enable theme editor that option:
- Go to
- SG Security
- Site Security
- Disable Themes & Plugins Editor Option
I hope this is useful for you.