Here’s another note to myself.
Add this to be able to upload SVGs, fonts and whatever file type you want. Careful with this one, uploading anything means uploading anything, so there could be security risks here to be aware of.
define( ‘ALLOW_UNFILTERED_UPLOADS’, true );
Set a default theme:
define('WP_DEFAULT_THEME', 'your-theme-folder-name');
Two fold, you get debugging, but instead of spitting it out on the screen, errors get thrown into a log in the WordPress directory. A very useful hack for troubleshooting issues on live sites.
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
Keep your database lean, especially on sites with lots of users, pages and posts. Your database can blow up quickly and slow down your site significantly with all the revisions being written and saved to your database.
define('WP_POST_REVISIONS', 5);
or disable them:
define('WP_POST_REVISIONS', false);
I use this a lot because WordPress releases are never straight forward and break stuff. When added, it disables all automatic updates in WordPress. This includes updates for the WordPress core, plugins, themes, and translations. It’s especially useful for website managers who prefer to handle updates manually, ensuring that they have full control over any changes to their site.
define( 'AUTOMATIC_UPDATER_DISABLED', true );
For security reasons, you may want to disable the file editor inside the WordPress dashboard. This constant disables the theme and plugin editor.
define('DISALLOW_FILE_EDIT', true);
You can also disable installing any plugins too:
define( 'DISALLOW_FILE_MODS', true );
I don’t like this one, because I like to manually delete pages and posts from the trash, but here it is anyways.
define('EMPTY_TRASH_DAYS', 7);
If you think your database may be corrupted or not running optimally, you can add this to force an automatic repair.
define('WP_ALLOW_REPAIR', true);
Normally, you can set your WordPress and Site URLs from Settings » General page. However, you may not be able to do that if you don’t have access to your WordPress site, seeing redirect errors, or have just moved your site.
In that case, you can change your site and WordPress URLs via wp-config.php file by adding the following lines:
define('WP_HOME', 'http://www.example.com');
define('WP_SITEURL', 'http://www.example.com');
WordPress allows you to override file permissions
define('FS_CHMOD_FILE', 0644);
define('FS_CHMOD_DIR', 0755);