Block file editing in WordPress

Last Revised: October 2, 2021

People, in general, are curious by nature and that makes that, if from the administration panel you can touch something, we touch it. This, in the part of the templates, can imply that “something stops working”. For this there is the possibility of blocking the editing of files and that, if necessary, it has to be done via FTP or SSH. To do this we will add the following line the configuration file [wp-config.php]:

define('DISALLOW_FILE_EDIT', true);

In addition, we can be a little more aggressive and block the possibility that you can add templates (themes) or extensions (plugins) from the administration panel. To do this we will add the following line the configuration file [wp-config.php]:

define('DISALLOW_FILE_MODS', true);

Seguir con Seguridad para WordPress


About this document

This document is regulated by the EUPL v1.2 license, published in WP SysAdmin and created by Javier Casares. Please, if you use this content in your website, your presentation or any material you distribute, remember to mention this site or its author, and having to put the material you create under EUPL license.