Integrated Tech Solutions

Wp-Config file – These 7 hacks will blow your mind

By - Admin, Updated on August 28, 2021

Introduction

Wp-config.php is perhaps one of the most important files each WordPress developer must be aware of. It’s not a good practice for beginners to edit this file. If you’re an experienced developer who loves to play with code, you can take the risk of editing the wp-config.php file.

Enable/Disable Debugging in wordpress

Many times we’re unable to find the exact problem in your website, enabling the debug mode can save a lot of time, and you can see the errors & warnings to fix the problem.

define(‘WP_DEBUG’, true);

Enable Debug Mode

Turn Off the Theme & File Editor in Dashboard

define(‘DISALLOW_FILE_EDIT’, true);

Disable file editor in WordPress Dashboard

Disable Theme & Plugin installation

define( ‘DISALLOW_FILE_MODS’, true );

Disable Plugins/Themes installation

Define Database Table prefix

By default, all WordPress tables names start with “wp_”. But if you want to change the prefix, you can do it by updating the wp-config file as shown below –

$table_prefix = ‘dev_’;

Change the WordPress DB Table Prefix to dev_

Define Autosave interval

To prevent data loss while working on posts content, WordPress has an autosave feature that saves the post you’re working on, every 1 minute automatically. If you want to change the autosave interval, you can do it as shown below-

define( ‘AUTOSAVE_INTERVAL’, 120 ); 

Change Autosave interval to 2 minutes

Modify Post Revisions

Disable Post Revisions in WordPress

define(‘WP_POST_REVISIONS’, false );

Disable Posts Revisions

Limit the no. of Post Revisions

define( ‘WP_POST_REVISIONS’, ‘5’ );

Limits No. of revisions to 5 for each post

Increase memory limits

While working on WordPress, you may encounter an error like “This file exceeds the maximum file upload size”. To fix it, you can increase the WordPress memory limit by adding the code to wp-config file as shown below-

define( ‘WP_MEMORY_LIMIT’, ‘256M’ );

Increase memory limit to 256 Mb

Enable/Disable WordPress automatic updates

define(‘WP_AUTO_UPDATE_CORE’, true);

Disable Automatic updates in wordpress

Articles You May Also Like

Keep Reading

👋 Hi, Find this Helpful? There is More

20 Most asked Odoo Interview Questions

Odoo Accounting Interview Questions

Know More »
shopify sections and blocks

How to create Custom Sections in Shopify[Dawn Theme]

Are you looking to customize your Shopify store beyond the standard templates and themes? Do you want to create unique...

Know More »
fix japanese keyword hack

Looking for Video Tutorials?

Explore Our Youtube Channel for in-depth Tutorials

Yes I am Curious »