20

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 http://www.nameofsite.com/wp-admin/theme-editor.php 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?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
user3192304
  • 337
  • 1
  • 3
  • 10

12 Answers12

45

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

Jirka Štencek
  • 466
  • 1
  • 6
  • 2
16

Open up your wp-config.php file, and search for

define('DISALLOW_FILE_EDIT', true);

Change true to false:

define('DISALLOW_FILE_EDIT', false);
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Peter
  • 620
  • 4
  • 8
8

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.

Harsh Prajapati
  • 510
  • 5
  • 7
5

If you used Siteground host.. you can enable theme editor that option:

  1. Go to domain.com/wp-admin.php
  2. SG Security
  3. Site Security
  4. Disable Themes & Plugins Editor Option

I hope this is useful for you.

Khaled Daqqa
  • 61
  • 1
  • 5
4

Hack:

Manually browse: domain.com/wp-admin/theme-editor.php

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Rashedul Islam Sagor
  • 1,943
  • 14
  • 20
3

At 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);
Atif Tariq
  • 2,650
  • 27
  • 34
1

The 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.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Tim Leon
  • 11
  • 2
1

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.

eldervl
  • 11
  • 2
1

Remove both codes

define('DISALLOW_FILE_EDIT', false);
define('DISALLOW_FILE_MODS', true);

After this just refresh, the dashboard Theme editor will appear.

Vel
  • 9,027
  • 6
  • 34
  • 66
stepiadm
  • 21
  • 5
0

To enable the theme editor, follow these steps:

  1. Go to Appearance, select one theme (any one you like) and activate it.
  2. In this activated theme, go to AppearanceEditor → select the theme to edit (on the top right, above Templates. There is a drop-down click on it and select your previous theme.)
  3. Now select config.php or demo config.php and remove the define ( 'DISALLOW_FILE_EDIT, true); code.
  4. Now click on Update file.
  5. Now change the theme to your previous theme.

Now you can find your editor in the Appearance drop-down.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Silpa
  • 41
  • 1
  • thank you but i could find appearance in the options of porto themes for wordpress. – Nzui Manto Oct 05 '18 at 07:52
  • 10
    This isn't correct, the questioner's issue is that appearance --> editor isn't appearing, you're telling them to use that path within the answer. The problem is a security setting as talked about below, they need to go into wp-config.php or deactivate this security feature with the plugin they are using. – logos_164 Nov 28 '18 at 15:36
0

There might have set DISALLOW_FILE_EDIT constant value to true somewhere in your wordpress website. All you need to do is set that value to false.

define('DISALLOW_FILE_EDIT', false);

It should be in wp-config.php or wp-settings.php usually. But it could be in some where else depends on the website builder.

infomasud
  • 2,263
  • 1
  • 18
  • 12
0

Note that when you are using a block enabled theme, it's no longer possible to edit your theme and plugin files directly from within WordPress. https://wordpress.org/support/topic/link-to-plugin-editor-missing-when-using-twenty-twenty-two-theme/

Jules Colle
  • 11,227
  • 8
  • 60
  • 67