15 Useful WordPress Configuration Tricks That You May Not Know

WP-config is one of the most powerful files on your WordPress site, and it plays an important role in how WordPress works behind the scenes. There are

WordPress Information:15 Useful WordPress Configuration Tricks That You May Not Know

WP-config is likely of the strongest information in your website, and it performs an vital position in how WordPress behind the scenes. (*15*)

There are some very helpful WordPress configuration methods that almost all freshmen don't find out about. (*15*)

On article, 'll share among the most helpful WordPress configuration methods that can show you how to troubleshoot, optimize, and safe your WordPress website.(*15*)15 Useful WordPress Configuration Tricks That You May Not Know

Tips on how to Use these WordPress Configuration Tricks?

WordPress comes with a robust configuration file referred to as wp-config.php. It's positioned within the root of each WordPress website and comprises vital configuration settings.(*15*)

To study extra, see our information on easy methods to edit wp-config.php file in WordPress.(*15*)

All the perfect WordPress internet hosting corporations include 1-click WordPress set up which suggests you'll by no means have to edit the wp-config.php file in the course of the set up. That is the principle purpose why many customers should not conversant in the facility of this file.(*15*)

You can use the wp-config file to troubleshoot, optimize, and safe your WordPress website.(*15*)

The wp-config.php file is a robust device, and a tiny mistake within the code could make your web site inaccessible. You ought to solely edit this file when and at all times create an entire WordPress backup earlier than making any modifications,(*15*)

That being stated, let's check out some helpful WordPress configuration methods that you need to use in your WordPress web site.(*15*)

1. The Primary WordPress Configuration Settings

By default, you simply have to fill within the database settings throughout WordPress set up. In case you don't have a wp-config.php file current, then you may be requested to create one by filling in your database info.(*15*)15 Useful WordPress Configuration Tricks That You May Not Know

WordPress will attempt to mechanically save these settings by producing a wp-config.php file. Nonetheless, if it fails, then you have to so as to add them manually.(*15*)

To do this, you have to to attach together with your web site utilizing an FTP consumer. As soon as related, you have to to rename the wp-config-sample.php file to wp-config.php.(*15*)15 Useful WordPress Configuration Tricks That You May Not Know

After that, you possibly can go forward and edit the newly created wp-config.php file. You might want to add your database info by altering the next strains:(*15*)

outline('DB_NAME', 'database-name');outline('DB_USER', 'database-username');outline('DB_PASSWORD', 'database-password');outline('DB_HOST', 'localhost');
Hosted with ❤️ by WPCode
1-click Use in WordPress

Don't neglect to avoid wasting your modifications and add the file again to the server.(*15*)

2. Including Safety Keys in WordPress

The default WordPress set up mechanically provides safety keys to your configuration file. These safety keys are used so as to add an additional safety layer to your WordPress login and cookie authentication.(*15*)

You can at all times regenerate safety keys in case you really feel somebody could also be accessing your web site with out correct authentication. Altering safety keys will log off all logged in customers.(*15*)

outline( 'AUTH_KEY',         'put your distinctive phrase right here' );outline( 'SECURE_AUTH_KEY',  'put your distinctive phrase right here' );outline( 'LOGGED_IN_KEY',    'put your distinctive phrase right here' );outline( 'NONCE_KEY',        'put your distinctive phrase right here' );outline( 'AUTH_SALT',        'put your distinctive phrase right here' );outline( 'SECURE_AUTH_SALT', 'put your distinctive phrase right here' );outline( 'LOGGED_IN_SALT',   'put your distinctive phrase right here' );outline( 'NONCE_SALT',       'put your distinctive phrase right here' );
Hosted with ❤️ by WPCode
1-click Use in WordPress

For extra info, see our article on WordPress safety keys and easy methods to use them.(*15*)

3. Change WordPress Desk Prefix

A typical default WordPress set up provides a wp_ prefix to all WordPress database desk names. Some WordPress safety specialists consider that altering the desk prefix could make your WordPress database safer.(*15*)

To do this you, want to alter the next line in your WordPress configuration.(*15*)

$table_prefix = 'wp_';
Hosted with ❤️ by WPCode
1-click Use in WordPress

If you're doing this for an present web site, then additionally, you will want to alter the desk prefix in your WordPress database. To do this, see our article on easy methods to change the WordPress database prefix.(*15*)

4. Activate Debugging in WordPress

WordPress comes with a neat debugging characteristic that means that you can see or disguise WordPress errors when in debug mode. To show this on, you have to so as to add this rule in your WordPress configuration file.(*15*)

outline( 'WP_DEBUG', true );
Hosted with ❤️ by WPCode
1-click Use in WordPress

You may activate debugging whereas hiding the errors in your web site and saving them in a log file as a substitute. To do this, add the next strains to your configuration settings.(*15*)

outline( 'WP_DEBUG', true );outline( 'WP_DEBUG_LOG', true );outline( 'WP_DEBUG_DISPLAY', false );
Hosted with ❤️ by WPCode
1-click Use in WordPress

This may create a debug.log file inside wp-content folder of your web site and retailer all debugging errors and notices contained in the log file.(*15*)

5. Altering Your Website or WordPress Deal with

Usually, you possibly can set your WordPress and Website URLs from Settings » Normal web page. Nonetheless, it's possible you'll not be capable to try this in case you don't have entry to your WordPress website, seeing redirect errors, or have simply moved your website.(*15*)

In that case, you possibly can change your website and WordPress URLs by way of wp-config.php file by including the next strains:(*15*)

outline('WP_HOME', 'http://www.instance.com');outline('WP_SITEURL', 'http://www.instance.com');
Hosted with ❤️ by WPCode
1-click Use in WordPress

Don't neglect to switch instance.com with your personal area identify.(*15*)

6. Override File Permissions

WordPress means that you can override file permissions in case your host has restrictive permissions for all person information. Most customers don't want this, however it exists for many want it.(*15*)

outline('FS_CHMOD_FILE', 0644);outline('FS_CHMOD_DIR', 0755);
Hosted with ❤️ by WPCode
1-click Use in WordPress

To study extra about file permissions, see our article on how-to repair file and folder permissions error in WordPress.(*15*)

7. Altering Submit Revision Settings

WordPress has a really helpful a submit revisions characteristic which lets you undo modifications to your posts and pages by reverting again to a earlier model or an autosave.(*15*)

You can disable or change submit revision settings by way of the configuration file. Listed here are completely different submit revision settings that you need to use.(*15*)

You can change how typically WordPress shops an autosave as a revision by including the next line:(*15*)

outline('AUTOSAVE_INTERVAL', 120); // in seconds
Hosted with ❤️ by WPCode
1-click Use in WordPress

Some articles in your website might have dozens of submit revisions relying on how lengthy it took to put in writing them. In case you assume that characteristic annoys you, then you possibly can restrict the variety of revisions per submit.(*15*)

outline('WP_POST_REVISIONS', 10);
Hosted with ❤️ by WPCode
1-click Use in WordPress

If for some purpose, you need to disable the submit revisions characteristic altogether (not really useful in any respect), then you need to use the next code to disable submit revisions.(*15*)

outline( 'WP_POST_REVISIONS', false );
Hosted with ❤️ by WPCode
1-click Use in WordPress

8. Altering WordPress Trash Settings

WordPress comes with a recycle bin characteristic referred to as Trash. When a person sends a submit to trash, it's nonetheless saved in your web site for subsequent 30 days as trash. After that point, WordPress mechanically deletes them ceaselessly.(*15*)

You can change this habits by altering the variety of days you need to preserve the trash.(*15*)

outline( 'EMPTY_TRASH_DAYS', 15 ); // 15 days
Hosted with ❤️ by WPCode
1-click Use in WordPress

If you don't like this characteristic, then you possibly can disable it by including the operate beneath:(*15*)

outline('EMPTY_TRASH_DAYS', 0 );
Hosted with ❤️ by WPCode
1-click Use in WordPress

Observe: Utilizing zero means your posts can be deleted completely. WordPress wouldn't ask for affirmation once you click on on Delete Completely. Any unintentional click on may value you…(*15*)

To study extra, see our article on easy methods to restrict or disable automated trash characteristic in WordPress.(*15*)

9. Including FTP/SSH Constants to WordPress Configuration

By default, WordPress means that you can improve WordPress core, themes, and plugins from the admin dashboard. There are some hosts that require an FTP or SSH connection everytime you attempt to improve, or set up a brand new plugin.(*15*)15 Useful WordPress Configuration Tricks That You May Not Know

By utilizing the codes, you possibly can set the FTP or SSH constants and by no means have to fret about it once more.(*15*)

// forces the filesystem technique: "direct", "ssh", "ftpext", or "ftpsockets"outline('FS_METHOD', 'ftpext');// absolute path to root set up directorydefine('FTP_BASE', '/path/to/wordpress/');// absolute path to "wp-content" directorydefine('FTP_CONTENT_DIR', '/path/to/wordpress/wp-content/');// absolute path to "wp-plugins" directorydefine('FTP_PLUGIN_DIR ', '/path/to/wordpress/wp-content/plugins/');// absolute path to your SSH public keydefine('FTP_PUBKEY', '/residence/username/.ssh/id_rsa.pub');// absolute path to your SSH personal keydefine('FTP_PRIVKEY', '/residence/username/.ssh/id_rsa');// both your FTP or SSH usernamedefine('FTP_USER', 'username');// password for FTP_USER usernamedefine('FTP_PASS', 'password');// hostname:port combo in your SSH/FTP serverdefine('FTP_HOST', 'ftp.instance.org:21'); 
Hosted with ❤️ by WPCode
1-click Use in WordPress

Observe: Don't neglect to switch the WordPress path and http://ftp.instance.com with your personal FTP Host info.(*15*)

10. Permit Automated Database Restore

WordPress comes with a built-in characteristic to mechanically optimize and restore WordPress database. Nonetheless, this characteristic is turned off by default.(*15*)

To allow this characteristic it's to add the next line to your WordPress configuration file.(*15*)

outline('WP_ALLOW_REPAIR', true);
Hosted with ❤️ by WPCode
1-click Use in WordPress

After including this, it's good to go to the next URL to optimize and restore WordPress database(*15*)

http://instance.com/wp-admin/maint/restore.php(*15*)

Don't neglect to switch instance.com with your personal area identify. You will see a easy web page with the choices to restore or restore and optimize the database. You don't have to be logged in to entry this web page.(*15*)15 Useful WordPress Configuration Tricks That You May Not Know

11. Enhance PHP Reminiscence Restrict

A number of the most typical WordPress errors are brought on by PHP reminiscence exhausted. You can improve the PHP reminiscence restrict by way of wp-config.php file. Merely paste the code beneath:(*15*)

outline('WP_MEMORY_LIMIT', '128M');
Hosted with ❤️ by WPCode
1-click Use in WordPress

12. Transferring wp-content Listing

WordPress means that you can transfer your wp-content listing. Some specialists consider that it could actually assist strengthen WordPress safety.(*15*)

You might want to add the next code to your wp-config.php file:(*15*)

outline( 'WP_CONTENT_DIR', $_SERVER['DOCUMENT_ROOT'] . '/weblog/wp-content' );outline( 'WP_CONTENT_URL', 'http://instance/weblog/wp-content');outline( 'WP_PLUGIN_DIR', $_SERVER['DOCUMENT_ROOT'] . '/weblog/wp-content/plugins' );outline( 'WP_PLUGIN_URL', 'http://instance/weblog/wp-content/plugins');
Hosted with ❤️ by WPCode
1-click Use in WordPress

Don't neglect to switch instance.com with your personal area identify.(*15*)

13. Use Customized Consumer Tables

By default, WordPress saves all person knowledge within the tables wp_users and wp_usermeta. By utilizing the operate beneath, you possibly can specify the desk the place you need your person info saved.(*15*)

outline('CUSTOM_USER_TABLE', $table_prefix.'my_users');outline('CUSTOM_USER_META_TABLE', $table_prefix.'my_usermeta');
Hosted with ❤️ by WPCode
1-click Use in WordPress

14. Allow Multi-Website Community

Every WordPress website comes with a built-in multisite characteristic which lets you create a number of WordPress websites utilizing the identical set up. To study extra, see our full information on easy methods to set up and setup WordPress multisite community.(*15*)

You can allow multisite performance by including the next line to your WordPress configuration file:(*15*)

outline('WP_ALLOW_MULTISITE', true);
Hosted with ❤️ by WPCode
1-click Use in WordPress

15. Securing Your WordPress Configuration File

As you possibly can see, the wp-config.php file comprises actually vital WordPress settings. By default it's positioned within the root WordPress folder, however you possibly can transfer it. It may be moved exterior your public_html listing, so customers can't entry it. WordPress is aware of by default to look in different directories if the information isn't discovered within the WordPress root folder.(*15*)

You may add the next code to your .htaccess file to restrict entry to this file.(*15*)

# Shield wp-config.php<Information wp-config.php>    order permit,deny    deny from all</Information>
Hosted with ❤️ by WPCode
1-click Use in WordPress

We hope this text helped you study some helpful WordPress configuration methods that you simply didn't know. You can also need to see our mega record of 55+ most needed WordPress suggestions, methods, and hacks that you need to use in your website or our picks of the perfect WordPress plugins for enterprise websites.(*15*)

Abraham

Abraham

Young people who are passionate about web front-end development and programming. Specialized in computer science during college, has a deep understanding and technical proficiency in front-end and user experience. The personal blog shares front-end development and design experience, and provides some free website construction and programming tutorials.

Articles: 119

Leave a Reply

Your email address will not be published. Required fields are marked *