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

Deaktivieren von Theme- und Plugin-Editoren in der WordPress-Administrationsleiste

Hinweis der Redaktion: Wir erhalten eine Provision für Partnerlinks auf WPBeginner. Die Provisionen haben keinen Einfluss auf die Meinung oder Bewertung unserer Redakteure. Erfahre mehr über Redaktioneller Prozess.

Wussten Sie, dass WordPress über einen integrierten Theme- und Plugin-Editor verfügt? Mit diesem einfachen Code-Editor können Sie Ihre Theme- und Plugin-Dateien direkt über das WordPress-Dashboard bearbeiten.

Das mag zwar sehr hilfreich sein, kann aber auch zu Problemen führen, z. B. zum Zusammenbruch Ihrer Website und zu potenziellen Sicherheitsproblemen, wenn es mit anderen Schwachstellen kombiniert wird.

In diesem Artikel wird erklärt, warum und wie man Theme- und Plugin-Editoren im WordPress-Administrationsbereich deaktivieren kann.

Disable theme and plugin editors in WordPress admin area

Warum sollten Theme- und Plugin-Editoren in WordPress deaktiviert werden?

WordPress verfügt über einen integrierten Code-Editor, mit dem Sie WordPress-Theme- und Plugin-Dateien direkt im Verwaltungsbereich bearbeiten können.

Der Theme-Editor befindet sich auf der Seite Erscheinungsbild “ Theme-Dateieditor. Standardmäßig werden dort die Dateien Ihres derzeit aktiven Themes angezeigt.

Theme file editor in WordPress

Der Plugin-Editor ist ebenfalls auf der Seite Plugins “ Plugin File Editor zu finden. Standardmäßig wird Ihnen eines der installierten Plugins Ihrer Website angezeigt, das in alphabetischer Reihenfolge an erster Stelle steht.

Plugin file editor in WordPress

Wenn Sie die Theme- oder Plugin-Editor-Seite zum ersten Mal besuchen, warnt WordPress Sie, dass die Verwendung des Editors Ihre Website beschädigen kann.

Theme editor warning in WordPress

In WordPress 4.9 wurden die Theme- und Plugin-Editoren aktualisiert, um Benutzer vor versehentlichem Zerstören ihrer Website zu schützen. In den meisten Fällen wird der Editor einen fatalen Fehler erkennen und die Änderungen rückgängig machen.

Dies ist jedoch nicht garantiert, und es kann immer noch Code durchrutschen, so dass Sie den Zugriff auf den WordPress-Verwaltungsbereich verlieren würden.

Das größte Problem mit dem eingebauten Dateieditor ist, dass er vollen Zugriff auf jede Art von Code auf Ihrer Website ermöglicht.

Wenn ein Hacker in Ihren WordPress-Administrationsbereich eindringt, kann er den integrierten Editor verwenden, um Zugriff auf alle Ihre WordPress-Daten zu erhalten.

Hacker können es auch nutzen, um Malware zu verbreiten oder DDOS-Angriffe von Ihrer WordPress-Website aus zu starten.

Um die Sicherheit von WordPress zu verbessern, empfehlen wir, die eingebauten Datei-Editoren vollständig zu entfernen.

Sehen wir uns also an, wie man Theme- und Plugin-Editoren in WordPress ganz einfach deaktivieren kann.

So deaktivieren Sie Theme- und Plugin-Editoren in WordPress

Die Deaktivierung von Theme- und Plugin-Editoren in WordPress ist recht einfach. Allerdings muss dazu Code in WordPress eingefügt werden. Wenn Sie das noch nicht getan haben, lesen Sie unsere Anleitung zum Einfügen von Snippets aus dem Web in WordPress.

Sie müssen diese Codezeile in die Datei functions.php Ihres Themes, in ein Site-spezifisches Plugin oder mit Hilfe eines Code-Snippets-Plugins einfügen.

define( 'DISALLOW_FILE_EDIT', true );

Wir empfehlen die Verwendung des WPCode-Plugins, da es kostenlos und einfach zu verwenden ist und Ihre Website nicht beschädigt, wenn etwas schief geht.

Hinweis: Es gibt auch eine Premium-Version von WPCode, die erweiterte Funktionen wie Code-Revisionen, automatische Konvertierungspixel, geplante Snippets und mehr bietet.

Zunächst müssen Sie das kostenlose WPCode-Plugin installieren und aktivieren. Detaillierte Anweisungen finden Sie in unserer Anleitung zur Installation eines WordPress-Plugins.

Sobald das Plugin aktiviert ist, gehen Sie in Ihrem WordPress-Dashboard zu Code Snippets Snippet hinzufügen. Fahren Sie dann mit der Maus über die Option „Eigenen Code hinzufügen (neues Snippet)“ und klicken Sie auf die Schaltfläche „Snippet verwenden“.

Add a new custom code snippet in WPCode

Fügen Sie dann einen Titel für Ihr Snippet hinzu und fügen Sie den Code von oben in das Feld „Codevorschau“ ein. Außerdem müssen Sie im Dropdown-Menü auf der rechten Seite „PHP-Snippet“ als Codetyp auswählen.

Paste code snippet into WPCode

Danach schalten Sie einfach den Schalter von „Inaktiv“ auf „Aktiv“ um und klicken auf die Schaltfläche „Snippet speichern“.

Activate and save your custom code snippet

Das ist alles, Plugin- und Theme-Editoren verschwinden nun aus den Menüs für Themes und Plugins im WordPress-Adminbereich.

Alternativ können Sie auch Ihre wp-config.php-Datei bearbeiten und den obigen Code kurz vor der Zeile „That’s all, stop editing! Viel Spaß beim Veröffentlichen“:

Speichern Sie dann Ihre Änderungen und laden Sie die Datei wieder auf Ihre Website hoch.

Wenn Sie die Dateien nicht direkt bearbeiten möchten, können Sie das Sucuri WordPress Plugin installieren, das die 1-Klick-Härtungsfunktion bietet.

Richtiges Bearbeiten von WordPress-Theme- und Plugin-Dateien

Viele Benutzer verwenden WordPress-Theme- und Plugin-Editoren, um den Code nachzuschlagen, benutzerdefinierte CSS hinzuzufügen oder den Code in ihren Child-Themes zu bearbeiten.

Wenn Sie Ihrem Theme nur benutzerdefinierte CSS hinzufügen möchten, können Sie dies mit dem Theme-Customizer tun, der sich unter Darstellung “ Anpassen befindet.

Adding custom CSS via theme customizer

Weitere Einzelheiten finden Sie in unserem Leitfaden zum Hinzufügen von benutzerdefiniertem CSS in WordPress, ohne dass Ihre Website beschädigt wird.

Wenn Sie den Code in einem Plugin nachsehen wollen, können Sie dies mit einem FTP-Client tun.

Zur besseren Dateiverwaltung und Syntaxhervorhebung können Sie einen dieser Code-Editoren für die Bearbeitung von WordPress-Dateien auf Ihrem Computer verwenden.

Nicht zuletzt können Sie auch ein benutzerdefiniertes WordPress-Theme erstellen, ohne irgendeinen Code zu schreiben.

Wir hoffen, dass dieser Artikel Ihnen geholfen hat, zu lernen, wie man Theme- und Plugin-Editoren im WordPress-Admin-Panel einfach deaktivieren kann. Vielleicht interessieren Sie sich auch für unseren ultimativen Leitfaden zur Verbesserung der WordPress-Leistung und -Geschwindigkeit oder unsere Expertenauswahl der besten Webdesign-Software.

Wenn Ihnen dieser Artikel gefallen hat, dann abonnieren Sie bitte unseren YouTube-Kanal für WordPress-Videotutorials. Sie können uns auch auf Twitter und Facebook finden.

Offenlegung: Unsere Inhalte werden von unseren Lesern unterstützt. Das bedeutet, dass wir möglicherweise eine Provision verdienen, wenn Sie auf einige unserer Links klicken. Mehr dazu erfahren Sie unter Wie WPBeginner finanziert wird , warum das wichtig ist und wie Sie uns unterstützen können. Hier finden Sie unseren redaktionellen Prozess .

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.

Das ultimative WordPress Toolkit

Erhalte KOSTENLOSEN Zugang zu unserem Toolkit - eine Sammlung von WordPress-bezogenen Produkten und Ressourcen, die jeder Profi haben sollte!

Reader Interactions

33 KommentareEine Antwort hinterlassen

  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.

      Admin

  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

      Admin

  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?

Eine Antwort hinterlassen

Danke, dass du einen Kommentar hinterlassen möchtest. Bitte beachte, dass alle Kommentare nach unseren kommentarpolitik moderiert werden und deine E-Mail-Adresse NICHT veröffentlicht wird. Bitte verwende KEINE Schlüsselwörter im Namensfeld. Lass uns ein persönliches und sinnvolles Gespräch führen.