Skip to main content

Editing Themes and Files from the WordPress Admin Dashboard

An enabled file editor is a security risk. If you must use it, learn how to safely enable the WordPress built-in editor and revert it afterward.

WordPress's built-in file editor is disabled by default at Seravo for security reasons. This guide shows you how to temporarily enable the editor to modify your theme or plugin files directly from the WordPress admin dashboard. This guide is aimed at experienced site administrators.

Prerequisites and Important Notes

  • Note on Security Guarantee: Seravo's Security Guarantee is not valid while the file editor is enabled. If an attacker manages to inject malicious code into the site while the editor is active, we will charge for the malware cleanup based on our hourly rate (€150/hour + VAT).

  • You will need an SSH or SFTP connection to your site to edit the wp-config.php file.

  • We strongly recommend making any file modifications primarily via a direct SSH or SFTP connection instead.

Step-by-Step Instructions

  1. Connect to your site: Establish a secure SSH or SFTP connection to your site (using a client like FileZilla).

  2. Open the wp-config.php file: Locate the wp-config.php file in the root directory (htdocs) of your site and open it with a text editor.

  3. Enable the editor: Find the line that says define('DISALLOW_FILE_EDIT', true); and change its value to false. If the line doesn't exist, you can add the following line to the file: define('DISALLOW_FILE_EDIT', false);

  4. Save your changes: Save the file to the server. You can now log into your WordPress admin dashboard and use the file editor (Appearance > Theme File Editor / Plugins > Plugin File Editor).

  5. Revert the setting: As soon as you have finished your edits in the admin dashboard, open wp-config.php again and change the value back to true. This will return WordPress to its secure state.

The line looks like this in the wp-config.php file:

/*  * Disable the theme/plugin file editor for security reasons  */
define('DISALLOW_FILE_EDIT', true);

Related Articles

Keep in mind that the most secure way to modify theme files or plugins is always directly via an SFTP or SSH connection. Doing so ensures that Seravo's Security Guarantee remains unbroken.

Did this answer your question?