Skip to content

RishadAlam/wp-plugin-editor-toggle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

WP Plugin Editor Toggle

Contributors: rishadbitcode
Tags: plugin editor, theme editor, security, admin tools, file editor toggle
Requires at least: 5.0
Tested up to: 6.5
Requires PHP: 7.0
Stable tag: 1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

A simple, no-bloat plugin that adds an admin menu toggle to enable or disable the Plugin and Theme Editor in WordPress.


🧠 Description

By default, WordPress allows administrators to edit plugin and theme files directly from the dashboard. While convenient, this can also be a security risk or cause unintended errors.

WP Plugin Editor Toggle lets you easily enable or disable those editors using a single buttonβ€”no need to touch code or edit wp-config.php.

Ideal for:

  • πŸ”’ Securing production environments
  • πŸ‘¨β€πŸ’Ό Client handoffs
  • πŸ§ͺ Preventing accidental file changes

🎯 Features

  • βœ… Adds an admin menu item titled Editor Toggle
  • πŸ”„ One-click form toggle to disable or enable the Plugin/Theme Editor
  • πŸ” When disabled, WordPress's file editors are completely inaccessible
  • 🧼 Simple UI β€” No settings, no configs, just works
  • πŸ’‘ Uses DISALLOW_FILE_EDIT internally, without modifying core files

πŸš€ Installation

  1. Upload the plugin to the /wp-content/plugins/ directory.
  2. Activate the plugin via the Plugins menu in WordPress.
  3. Go to Dashboard > Editor Toggle.
  4. Click Toggle Editor to enable or disable access to the built-in editors.

πŸ–₯️ How It Works

This plugin uses WordPress hooks to:

  • Add an admin menu item via add_menu_page()
  • Store the toggle state in the database using update_option()
  • On init, check the state and define DISALLOW_FILE_EDIT if needed

Code Snippet Behind the Scenes

if (get_option('plugin_editor_disabled')) {
    define('DISALLOW_FILE_EDIT', true);
}

About

Adds a toggle in the admin menu to enable/disable the Plugin and Theme Editor.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages