brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: define DISALLOW_FILE_EDIT to remove the wordpress theme and plugin code editors

WordPress
~/tips/tip-wordpress-disallow-file-edit-editors

define( 'DISALLOW_FILE_EDIT', true );

Removes the code editors from the wordpress admin menu so admins cannot edit PHP in the browser.

The built-in file editor gives anyone with an admin login a way to write PHP on the server.

define( 'DISALLOW_FILE_EDIT', true );

This line in wp-config.php removes the Theme File Editor and the Plugin File Editor from the admin menus. It is a small step against a stolen admin password, but it does not stop installing or updating plugins from the dashboard. That is a separate constant, DISALLOW_FILE_MODS. Put the line above the comment that says to stop editing. Your own edits then go through SFTP, git or a deploy script.

Further reading: WordPress: Editing wp-config.php

More WordPress tips wp user application-password create anna backup-script --porcelain define( 'MEDIA_TRASH', true ); wp cli check-update wp theme delete --all wp media image-size All WordPress tips (85) All topics

Link