Zum Inhalt springen
Jetpack

Einzelne Produkte

Sicherheit
VaultPress Backup Scan Akismet Anti-spam
Performance
Website-Suche Boost VideoPress
Wachstum
Stats Social Newsletter SEO Blaze CRM
Verwaltung
Manage Mobile App

Produktpakete

Pro Tools für Sicherheit, Performance und Wachstum für deine WordPress-Website. Abgeschlossen Die vollständige Jetpack-Suite mit höheren Service-Limits.
Preise
Übersicht Was Jetpack AI für deine Website tut Skills WordPress-Superkräfte für deinen Agenten Dokumentation Deinen KI-Agenten verbinden und einrichten Erste Schritte ChatGPT, Claude oder einen Coding-Agenten verbinden Vergleichen Jetpack im Vergleich mit anderen WordPress-MCP-Konnektoren

Verbinde deinen KI-Agenten. Kostenlos.

Verbinde ChatGPT oder Claude und lass die KI deine Website betreiben – ohne kostenpflichtigen Tarif.

Für ChatGPT holen (wird in einem neuen Tab geöffnet) Oder nutze Claude (wird in einem neuen Tab geöffnet)
Support Anleitungen und Hilfe von unserem Team Dokumentation Anleitungen zu jeder Jetpack-Funktion Feature-Anfragen Request features and vote on ideas Blog Neuigkeiten, Produkt-Updates und Anleitungen
Über uns
Anmelden Erste Schritte
Sicherheit
VaultPress Backup Scan Akismet Anti-spam
Performance
Website-Suche Boost VideoPress
Wachstum
Stats Social Newsletter SEO Blaze CRM
Verwaltung
Manage Mobile App

Produktpakete

Pro Abgeschlossen
Preise
Übersicht Was Jetpack AI für deine Website tut Skills WordPress-Superkräfte für deinen Agenten Dokumentation Deinen KI-Agenten verbinden und einrichten Erste Schritte ChatGPT, Claude oder einen Coding-Agenten verbinden Vergleichen Jetpack im Vergleich mit anderen WordPress-MCP-Konnektoren

Verbinde deinen KI-Agenten. Kostenlos.

Verbinde ChatGPT oder Claude und lass die KI deine Website betreiben – ohne kostenpflichtigen Tarif.

Für ChatGPT holen (wird in einem neuen Tab geöffnet) Oder nutze Claude (wird in einem neuen Tab geöffnet)
Support Anleitungen und Hilfe von unserem Team Dokumentation Anleitungen zu jeder Jetpack-Funktion Feature-Anfragen Request features and vote on ideas Blog Neuigkeiten, Produkt-Updates und Anleitungen
Über uns Suchen
Anmelden Erste Schritte

Blog / Jetpack 101

How to Disable File Editing in WordPress (DISALLOW_FILE_EDIT)

Avatar von Jen Swisher

Jen Swisher Oktober 17, 2025 · 6 Min. Lesezeit


Auf dieser Seite

  1. Why WordPress file editing is a security risk
  2. Method 1: Disable file editing via wp-config.php
  3. Method 2: Using the DISALLOW_FILE_MODS constant
  4. How to check if file editing is disabled
  5. How to re-enable WordPress file editing
  6. Other ways to protect your site
  7. How to take your site’s security to the next level
  8. Frequently asked questions

6 Min. Lesezeit

Being able to access your WordPress files directly within your dashboard is handy. You can jump in, tweak code, and save changes instantly. However, this convenience has a downside: If a hacker ever gains admin access, the file editor becomes an easy way for them to inject malicious code.

This is why many site owners choose to turn off file editing altogether.

In this guide, you’ll learn how to disable file editing in WordPress, why it’s crucial for protecting your site, and what to check afterward to keep everything running smoothly.

Why WordPress file editing is a security risk

WordPress includes two built-in editors that let administrators open and edit PHP files right from the dashboard. Depending on the type of theme you’re using, you’ll find them in slightly different places:

Classic Editor:

  • Appearance → Theme File Editor
  • Plugins → Plugin File Editor

Block themes ( Site Editor):

  • Tools → Theme File Editor
  • Tools → Plugin File Editor

At first glance, this seems convenient — you can tweak code without leaving your site. But here’s the catch: the same power is available to anyone with administrator access. If an attacker breaks into an admin account, they can inject malicious code, create backdoors, or even take the site offline.

Disabling the editors doesn’t mean you lose the ability to make changes. You (or your developer) can still access all theme and plugin files directly through your web server, SFTP, or hosting control panel. All you’re doing is removing an unnecessary shortcut that poses a significant security risk.

Method 1: Disable file editing via wp-config.php

The wp-config.php file stores settings that control how WordPress runs. Any changes you make here will remain in place, even after WordPress updates. Plus, if you ever need to restore the in-dashboard editors, you can simply remove the code you added.

To edit this file, you’ll need access to your WordPress root folder using SFTP, SSH, or your host’s file manager. This folder is usually named public_html, or it may be a subfolder inside. If you’re unsure where your installation is, check your hosting dashboard or ask your web host.

Here’s how to turn off file editing:

  1. Locate the file called wp-config.php in your site’s root folder.
  2. Open it and look for the line that says: /* That’s all, stop editing! Happy blogging. */
  3. Just above that line, add: define(‚DISALLOW_FILE_EDIT‘, true);
  4. Save the file (and re-upload it if you used SFTP).

That’s it! You’ve disabled file editing from the WordPress dashboard.

Method 2: Using the DISALLOW_FILE_MODS constant

If you want an even stricter setup, WordPress also supports DISALLOW_FILE_MODS. This setting is handy for high-security production sites where stability is more important than convenience.

This constant goes beyond removing file editing from your dashboard. Once added, it blocks the installation and updating of plugins, themes, and WordPress core from the admin dashboard.

Add this line to your wp-config.php file instead:

define('DISALLOW_FILE_MODS', true);

As with the DISALLOW_FILE_EDIT constant, you can still update everything manually via SFTP or your hosting control panel. These settings give you complete control while protecting your site from accidental or unauthorized changes.

How to check if file editing is disabled

After adding the code to your wp-config.php file, log in to your WordPress dashboard and check the location of the Theme File Editor and Plugin File Editor, depending on your theme (see above.)

If both links are gone, your changes were successful.

If the editors are still visible, try these troubleshooting steps:

  • Clear your browser and site cache.
  • Make sure you edited the correct file.
  • Double-check your syntax — a missing semicolon or incorrect quote can break the code.

Once everything is correct, you won’t be able to access these editors from the WordPress dashboard.

How to re-enable WordPress file editing

One advantage of removing file editing with the wp-config.php file is the ease of re-enabling it. If you ever need to restore file editing, you can simply remove your constants. 

Instead of deleting the line, consider commenting it out. This way, you can easily disable file editing again by simply removing the forward slashes (//), which helps maintain your site’s security. To do this:

  1. Open your wp-config.php file.
  2. Delete or comment out the line you added: // define(‚DISALLOW_FILE_EDIT‘, true);
  3. Save the file and reload your WordPress dashboard.

Once saved, the editor links will reappear, allowing you to make necessary changes. 

Man working on his laptop in an office with a lot of natural light.

Other ways to protect your site

Hardening your WordPress site with multiple layers of protection makes it more difficult for hackers to breach it. Disabling file editing is a good start, but it should be just one part of a broader security strategy.

Here are some simple steps that can make a big difference:

  • Use strong passwords: Make them long and unique — consider using a password manager to help you remember.
  • Enable two-factor authentication (2FA): A second verification step makes logins much safer.
  • Keep everything updated: This includes themes, plugins, and WordPress core.
  • Limit admin access: Only give administrator privileges to users who truly need them.
  • Use a security plugin: Scan for malware, monitor activity, and block suspicious logins.
  • Back up your site regularly: This allows you to restore quickly if something goes wrong.

Combined with disabling file editing, these steps give your WordPress site a strong defense.

How to take your site’s security to the next level

Turning off file editing is just one part of keeping your site safe. To protect your WordPress site comprehensively, you need tools that detect problems early, fix them quickly, and safeguard your data.

That’s where Jetpack Security comes in. It’s a bundle of tools built specifically for WordPress that strengthens your site across the board.

Jetpack Security includes:

  • Jetpack VaultPress Backup, which backs up your site in real time. If something goes wrong, you can restore everything with a single click.
  • Jetpack Scan, which monitors your site for malware, security issues, and suspicious changes. It sends automatic alerts so you can take action before visitors encounter problems.
  • Akismet, which blocks spam in comments and contact forms. Attackers often use spam to inject harmful links or scripts, and Akismet filters it out without slowing your site down.
  • A website application firewall, which blocks suspicious traffic from reaching your site.

These tools run quietly in the background, and you can access them all through the Jetpack dashboard. This lets you handle backups, security scans, and spam protection without juggling multiple accounts or plugins.

If you want a reliable, full-featured security setup that protects your site daily, Jetpack Security brings everything together in one package. It works smoothly with most themes and plugins and gives you peace of mind with minimal effort.

Frequently asked questions

Can I remove the theme editing and leave the plugin editing?

There’s no built-in way to block one while keeping the other. WordPress doesn’t separate the theme and plugin editors. When you use DISALLOW_FILE_EDIT, both editors disappear. 

Can I control this based on user roles?

While possible, it can get complicated. You could create a custom role that removes file editing capabilities using a plugin, but WordPress doesn’t have a capability specifically for file editing.

The editor relies on general permissions like edit_themes or edit_plugins, and removing those may break other admin functions. Disabling file editing via the wp-config.php file is the easiest and safest approach for most sites.

Can I still edit files another way?

Yes. Disabling the dashboard editor doesn’t prevent you from editing files through SFTP clients like FileZilla or Cyberduck, your web host’s file manager, Git deployments, or local development environments. You’re removing a feature that could pose a risk if a malicious actor gains access to an admin login.

Like Lade …
Avatar von Jen Swisher

Written by

Jen Swisher

Jen is a Customer Experience Specialist for Jetpack. She has been working with WordPress and Jetpack for over a decade. Before starting at Automattic, Jen helped small businesses, local non-profits, and Fortune 50 companies create engaging web experiences for their customers. She is passionate about teaching others how to create on the web without fear.

Wir schützen deine Website.
Du führst dein Unternehmen.

Jetpack Security bietet eine umfassende und einfach‑zu‑bedienende Sicherheit für WordPress-Websites, einschließlich Backups in Echtzeit, einer Web Application Firewall, Malware-Überprüfung und Spam-Schutz.

Sichern Sie Ihre Website

Questions about this post? Ask in the support forum

Teilen


Keep reading.

More from Jetpack 101, newest first.

Alle Beiträge ansehen

Jetpack 101 Mär 31, 2026

WordPress Image SEO: 12 Techniques to Rank Higher & Load Faster

Are images helping or hurting your rankings? What can you do about it? 12 realistic ways to optimize your image strategy for more high-quality traffic.

Avatar von Jen Swisher Jen Swisher 14 Min. Lesezeit

Jetpack 101 Mär 26, 2026

WordPress Site Redirecting to Spam? Here’s How to Fix a Hacked Site

Uncover hidden malware, remove malicious code, and stop spam redirects fast — before they damage your reputation. Secure your WordPress site.

Avatar von Jen Swisher Jen Swisher 12 Min. Lesezeit

Jetpack 101 Mär 24, 2026

WordPress Form with File Upload: How to Create One in 3 Steps

How to create a secure file upload form in WordPress — fast. Add drag-and-drop uploads in just 3 simple steps. Plus, the top tool to keep…

Avatar von Jen Swisher Jen Swisher 5 Min. Lesezeit

Betreibe deine WordPress-Website KI-first.

Free to start, and AI agents are free to connect. Money back within 14 days on yearly plans.

Erste Schritte Jetpack kostenlos holen

WordPress-Plugins

  • Akismet Anti-Spam↗ (wird in einem neuen Tab geöffnet)
  • Jetpack↗ (wird in einem neuen Tab geöffnet)
  • Jetpack Boost↗ (wird in einem neuen Tab geöffnet)
  • Jetpack CRM↗ (wird in einem neuen Tab geöffnet)
  • Jetpack Protect↗ (wird in einem neuen Tab geöffnet)
  • Jetpack Search↗ (wird in einem neuen Tab geöffnet)
  • Jetpack Social↗ (wird in einem neuen Tab geöffnet)
  • Jetpack VideoPress↗ (wird in einem neuen Tab geöffnet)
  • VaultPress Backup↗ (wird in einem neuen Tab geöffnet)
  • WP Super Cache↗ (wird in einem neuen Tab geöffnet)
  • Herunterladen

KI

  • Jetpack AI
  • Skills
  • WordPress MCP

Partner

  • Partnerprogramm
  • Empfohlene Hosts
  • Für Hosts
  • Für Agenturen
  • Für Partner

Entwickler

  • Dokumentation↗ (wird in einem neuen Tab geöffnet)
  • Beta-Programm
  • Jetpack auf GitHub↗ (wird in einem neuen Tab geöffnet)

Hilfe

  • Wissensdatenbank
  • Foren↗ (wird in einem neuen Tab geöffnet)
  • Bewertungen und Erfahrungsberichte
  • Kontakt aufnehmen
  • Über Jetpack
  • Presse
Sprache auswählen Deutsch
  • English
  • Deutsch
  • Español
  • Français
  • 日本語

© 2026 Automattic Inc. Alle Rechte vorbehalten.

  • Nutzungsbedingungen↗ (wird in einem neuen Tab geöffnet)
  • Datenschutzerklärung↗ (wird in einem neuen Tab geöffnet)
  • DSGVO

Mit Sorgfalt erstellt von

Im App Store laden Bei Google Play herunterladen
Lade Kommentare …
  • Rebloggen
  • Abonnieren Abonniert
    Jetpack
    Schließe dich 53.352 anderen Abonnenten an

    Hast du ein WordPress.com-Konto? Melde dich jetzt an.

  • Jetpack
    Kurzlink kopierenBeitrag im Reader lesen
    Abonnements verwaltenRegistrierenAnmelden
    Melde diesen Inhalt
    Diese Leiste einklappen
%d