Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
Copa WPB
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

Cómo desactivar los editores de temas y plugins desde el panel de administrador de WordPress

Nota editorial: Ganamos una comisión de los enlaces de socios en WPBeginner. Las comisiones no afectan a las opiniones o evaluaciones de nuestros editores. Más información sobre Proceso editorial.

¿Sabías que WordPress incorpora un editor de temas y plugins? Este editor de código plano te permite editar los archivos de tus temas y plugins directamente desde el escritorio de WordPress.

Ahora bien, esto puede parecer muy útil, pero también puede dar lugar a problemas como la ruptura de su sitio y los clientes potenciales problemas de seguridad cuando se combina con otras vulnerabilidades.

En este artículo, explicaremos por qué y cómo desactivar los editores de temas y plugins desde el área de administrador de WordPress.

Disable theme and plugin editors in WordPress admin area

¿Por qué desactivar los editores de temas y plugins en WordPress?

WordPress incorpora un editor de código que permite editar los archivos de temas y plugins directamente desde el área de administración.

El editor de temas se encuentra en la página Apariencia ” Editor de archivos de temas. Por defecto, mostrará los archivos del tema activo en ese momento.

Theme file editor in WordPress

Del mismo modo, el editor de plugins puede verse en la página Plugins ” Editor de archivos de plugins. Por defecto, le mostrará uno de los plugins instalados de su sitio que aparece primero en el orden alfabético.

Plugin file editor in WordPress

Si visita la página del editor de temas o plugins por primera vez, WordPress le advertirá de que el uso del editor puede romper su sitio web.

Theme editor warning in WordPress

En WordPress 4.9, los editores de temas y plugins fueron actualizados para proteger a los usuarios de romper accidentalmente su sitio web. En la mayoría de los casos, el editor detectará un error fatal y revertirá los cambios.

Sin embargo, esto no está garantizado y puede que algún código se cuele y acabe perdiendo el acceso al área de administrador de WordPress.

El mayor problema del editor de archivos integrado es que permite añadir cualquier tipo de código a su sitio web.

Si un hacker entra en su área de administrador de WordPress, puede utilizar el editor integrado para acceder a todos sus datos de WordPress.

Los hackers también pueden utilizarlo para distribuir malware o lanzar ataques DDOS desde su sitio web WordPress.

Para mejorar la seguridad de WordPress, recomendamos quitar / eliminar completamente los editores de archivos incorporados.

Dicho esto, veamos cómo desactivar fácilmente los editores de temas y plugins en WordPress.

Cómo desactivar los editores de temas y plugins en WordPress

Desactivar los editores de temas y plugins en WordPress es bastante fácil. Pero, requiere añadir código en WordPress. Si no lo has hecho antes, consulta nuestra guía sobre cómo pegar fragmentos de código de la web en WordPress.

Tendrá que añadir esta línea de código al archivo functions. php de su tema, a un plugin específico del sitio o utilizando un plugin de fragmentos de código.

define( 'DISALLOW_FILE_EDIT', true );

Recomendamos usar el plugin WPCode porque es gratuito, fácil de usar y no romperá tu sitio web si algo va mal.

Nota: También existe una versión premium de WPCode que incluye características avanzadas como revisiones de código, píxeles de conversión automática, fragmentos de código programados y mucho más.

En primer lugar, tendrás que instalar y activar el plugin gratuito WPCode. Para obtener instrucciones detalladas, consulta nuestra guía sobre cómo instalar un plugin de WordPress.

Una vez activado el plugin, vaya a Fragmentos de código Añadir fragmento desde su escritorio de WordPress. A continuación, pase el ratón por encima de la opción “Añadir su código personalizado (nuevo fragmento)” y haga clic en el botón “Usar fragmento”.

Add a new custom code snippet in WPCode

A continuación, añada un título a su fragmento de código y pegue el código anterior en el cuadro “Vista previa del código”. También debe seleccionar “Fragmento de código PHP” como tipo de código en el menú desplegable de la derecha.

Paste code snippet into WPCode

Después, basta con cambiar el conmutador de “Inactivo” a “Activo” y hacer clic en el botón “Guardar fragmento de código”.

Activate and save your custom code snippet

Eso es todo, los editores de plugins y temas ahora desaparecerán de los menús de temas y plugins en el área de administrador de WordPress.

Como alternativa, también puede editar su archivo wp-config.php y pegar el código de arriba justo antes de la línea que dice ‘¡Eso es todo, deje de editar! Feliz publicación’:

A continuación, guarde los cambios y vuelva a subir el archivo a su sitio web.

Si no desea editar los archivos directamente, puede instalar el plugin Sucuri WordPress que ofrece la característica de refuerzo en 1 clic.

Forma correcta de editar archivos de temas y plugins de WordPress

En realidad, muchos usuarios utilizan los editores de temas y plugins de WordPress para buscar el código, añadir CSS personalizado o editar el código de sus temas hijo.

Si solo quieres añadir CSS personalizado a tu tema, puedes hacerlo utilizando el Personalizador de temas situado en Apariencia ” Personalizar.

Adding custom CSS via theme customizer

Para más detalles, consulte nuestra guía sobre cómo añadir CSS personalizado en WordPress sin romper su sitio.

Si desea consultar el código de un plugin, puede hacerlo utilizando un cliente FTP.

Para gestionar mejor los archivos y resaltar la sintaxis, puedes utilizar uno de estos editores de código para editar archivos de WordPress en tu ordenador.

Por último, pero no menos importante, también puede crear un tema de WordPress personalizado sin escribir ningún código.

Esperamos que este artículo te haya ayudado a aprender cómo desactivar fácilmente los editores de temas y plugins desde el panel de administrador de WordPress. También puedes consultar nuestra guía definitiva para mejorar el rendimiento y la velocidad de WordPress o nuestra selección de los mejores programas de diseño web.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Descargo: Nuestro contenido está apoyado por los lectores. Esto significa que si hace clic en algunos de nuestros enlaces, podemos ganar una comisión. Vea cómo se financia WPBeginner , por qué es importante, y cómo puede apoyarnos. Aquí está nuestro proceso editorial .

Avatar

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

El último kit de herramientas de WordPress

Obtenga acceso GRATUITO a nuestro kit de herramientas - una colección de productos y recursos relacionados con WordPress que todo profesional debería tener!

Reader Interactions

33 comentariosDeja una respuesta

  1. Syed Balkhi says

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. Jiří Vaněk says

    Thanks for the tutorial. I used the wp-config.php file and it works great. Especially for customer sites, this option seems very good to me, so that they don’t modify the codes of the site and also in terms of security.

    In the end, I chose the wp-config file mainly so that this function could not be simply turned off from the administration, where it didn’t make any sense to me.

  3. Bob Putnak says

    This wont accomplish anything these days.
    1) Using the CODE SNIPPETS solution, if the hacker has access to the admin panel, they will simply go to the CODE SNIPPETS panel and DISABLE the snippet.

    2) Likewise, if you added it to the wp-config file, I cant see any reason why someone with access to the Admin panel could not simply INSTALL the CODE SNIPPETS plugin, activate it, then set a rule for:

    define( ‘DISALLOW_FILE_EDIT’, true );

    Seems to me that if the hacker has access to the admin panel, there is absolutely no solution to this problem.

    If you disagree, please explain why. My login seems 100% sound.

    • WPBeginner Support says

      If someone has admin level access to your site then they could look to add a plugin to bypass the issue. There are other user roles that have access to these sections of your site but not the ability to add plugins and this can help protect you from a non-admin who has this level of access from getting into your files.

      Administrador

  4. isabella says

    Hello there! I have the opposite problem I need to add a CSS code in the editor BUT the editor disappeared.
    Do you have any suggestions?
    thanks a lot
    cheers

  5. Raj says

    Unfortunately this isn’t working for me, I have updated the wp-config.php file but the editor option is still there in my wp dashboard, can you suggest me something?

    • Dave says

      Hi Raj,

      I had the same issue, but was able to fix it. Not sure if this is your same issue, but I realized that when copy/pasting from an internet post, sometimes the single/double quotation marks (‘ ‘) or (” “) may be a curly quote vs. a straight quote. Try deleting the single quotes, and retyping them.

      Hope this helps!

      -Dave

  6. William Marques says

    Is it possible disable save option for all? I want show control panel for my clients, but I do not want that they save the changes.

  7. Bella says

    A trillion thank you’s!!

    This tiny piece of code has rocked my world!

    How have I not come across you in the past??

    Keep smiling – Bella

  8. Jimit Shah says

    hi
    I want to disable paste command ( through mouse and ctr+v)in my php file in theme editor. So that i can write code not copy any code from outside.I want to give access manual code writing . please help me

  9. Raja Dileep Kumar says

    define(‘DISALLOW_FILE_EDIT’, true); this function will work on themes/functions.php if i paste the code in wordpress

  10. John McNamara says

    Hi there just wondering if anyone found a way to get around this without access as we have paid $1800 for some to set up a Website that is just a theme with out any changes made to it and wants to be paid more to unlock the editor for us
    Please help!!

  11. Prasath says

    define( ‘DISALLOW_FILE_EDIT’, true );

    This one disable the editor for complete pages. I need to disable only for home page and for particular user(for Ex: Editor) . Coz I used page builder. My clients are not intrested to look over that..

    Can any one help me ….

  12. Mark Corder says

    I can also confirm that this works when the line is added to a Site-Specific Plugin – which you’ll also find the recipe for here on WPBeginner…

    … so Thanks to you folks for all of it!

  13. Melissa says

    Hey there! My cheeky developer has done this to me and I need access… is there a way to “undo” this clever trick without having FTP access?

    I am also a developer and able to edit the files without any issues, but my contracted developer wants to charge me to access the code… so I am hoping I can jump in somehow!

    Mel

    • Al Klein says

      Did you contract for ‘all deliverables’? If so, have him deliver the FTP password – it’s a deliverable. (It’s a contract, so it can be enforced by a court. You may not be able to sue for specific action, but you can sue for whatever it will cost to have another developer create a new site that’s exactly like the old one [which will probably bankrupt your existing developer – so it will make him prone to turn everything over to you].)

      If you didn’t have ‘all deliverables’ included in the contract, or don’t have a signed contract, consider it a cheap legal lesson. (Law school costs a lot more.)

      • Bill says

        Great tip.
        Is there a way to disable a specific editor (for example Elementor) for a specific post (page) type while still allowing access to the classic editor?
        I hope this can be done in the child functions file.

  14. Suresh Khanal says

    while reading this post I was wondering why would anyone need to hide the editor link in the WordPress Admin because it is only the administrators who gain access to those links and if they do not get permission to do the things the required, what’s the use? anywhere realize that is good with it helpful when you are setting up blogs for you clients. Thanks for the good tips.

  15. Mark Corder says

    This is an excellent tip – and it worked fine for me adding the line to the functions.php file in my twentytwelve-child-theme’s folder. I still see options for customizing the theme (header, background, etc.) – but the “editor” links are now gone. (I had to press CTRL-R to force a page reload to make them disappear.)

    I always try to remove everything from the backend that a client really shouldn’t be messing with, and those plugin & theme editors are just inviting disaster! It’s wonderful to be able to remove them with a single line of code…

    I really appreciate these tips that edit child-theme functions and files to accomplish something rather than just recommending another plugin – though I realize this departs a bit from the “beginner” stuff.

    And if you haven’t had this request a thousand times already, I’d love to see you folks open a “WPAdvanced” site for us hard-core folks!

    • Editorial Staff says

      Thanks for the feedback Mark. Yes, we have gotten the request for WPAdvanced in the past. For now our focus is to continue to improve WPBeginner (we’re still not there yet).

      -Syed

      Administrador

  16. Gray Ayer says

    A problem encountered with this technique is that it also prevents anyone from upgrading the outdated plugins. Any ideas on that, besides disabling the addition to the wp-config file, upgrading, then restoring the hardened security?

  17. joanpique says

    Hi, thanks for the tip, yes, it works on functions.php file.

    But this code turn me off my theme options page :(…, is there any other code that only hide editors or something to put in the options page for avoid hidding?

Deja tu comentario

Gracias por elegir dejar un comentario. Tenga en cuenta que todos los comentarios son moderados de acuerdo con nuestros política de comentarios, y su dirección de correo electrónico NO será publicada. Por favor, NO utilice palabras clave en el campo de nombre. Tengamos una conversación personal y significativa.