Best

Add Zone For You

brainstudioz's blog

By: Web Development Services

The wp-config file is one of the most important files in your WordPress installation. You can use it to customize your site to meet your needs. With wp-config, you can make your WordPress site more secure, apply best practices, reduce page load time, optimize your database and make many other customizations. You can find the wp-config.php file in the root folder of your WordPress installation. The root folder is usually the public_html directory on live servers.

In this article, we will see the best bits of wp-config that you can use in any WordPress site. You must add most of these fragments to the beginning of the file, however, some of the fragments go to the end of the file. We have specified the location you need to place each fragment, respectively.

1. CHANGE THE TABLE PREFIXES

To strengthen the security of WordPress, you can change the prefixes of the tables in your database. By default, WordPress uses the prefix wp_. However, you can modify that to a more secure prefix that contains more characters, therefore, more difficult to find out. You simply need to overwrite the value of the $ table prefix variable in your wp-config file.

/ **

* Prefix of WordPress database table.

*

* You can have multiple installations in a database if you give

* Each one a unique prefix. Only numbers, letters and underscores.

* Please!

* /

$ table_prefix = 'wp_';

2. ENABLE THE DEBUGGER OF WORDPRESS

WordPress has a built-in debugger that you can use to receive notifications about errors and different problems on your site. The WordPress debugger is disabled by default, since you should not use it on a production site, unless you want visitors to your website to see notifications about errors. However, you can easily enable it by changing the value of the WP_DEBUG constant from false to true in your wp-config file.

/ **

* For developers: WordPress debug mode.

*

* Change this to true to enable the display of warnings during development.

* It is strongly recommended that plug-in and theme developers use WP_DEBUG

* In their development environments.

*

* For information about other constants that can be used for debugging,

* visit the Codex.

*

* @link https://codex.wordpress.org/Debugging_in_WordPress

* /

define ('WP_DEBUG', true);

3. VACUUM OF TRASH AUTOMATICALLY

With the help of wp-config, you can configure how often WordPress empties your trash. You can specify the number of days after which your publications, pages, attachments that you moved to the Trash folder will be emptied. If you use 0 as a value, the Trash function will be completely deactivated on your site. You must add the following line of code to the beginning of your wp-config.php file:

define ('EMPTY_TRASH_DAYS', 30);

// 30 days

4. SPECIFY AN AUTOMATIC SAVINGS INTERVAL

WordPress automatically saves your publications and pages every 60 seconds by default. You can easily increase or decrease this value in your wp-config file. You must specify the interval in seconds and add the following line to the beginning of the file:

define ('AUTOSAVE_INTERVAL', 180);

// 180 seconds

5. LIMIT THE NUMBER OF POSTAL REVISIONS

WordPress automatically saves the revisions of the publication in the database as many times as the publication is saved. In addition, the last automatic save is also stored in the database. As a result, a single publication can have more than 20 or 30 versions in the table of the wp-posts database. Over time, this can lead to a lot of redundancies in the database. However, you can limit the number of revisions or deactivate it completely:

define ('WP_POST_REVISIONS', 5);

// save 5 subsequent revisions

define ('WP_POST_REVISIONS', false);

// deactivate subsequent revisions

6. CHANGE YOUR SITE AND THE BLOG'S ADDRESS

You can specify the URL of your website and home page in your wp-config file. If your WordPress installation is stored in your root folder, these two URLs will be the same. Although you can configure your site and

Home address in the WordPress panel, this feature can be a blessing if you can not access your administration area for some reason.

define ('WP_SITEURL', 'http://example.com/wordpress');

// the folder in which your basic WordPress files reside

define ('WP_HOME', 'http://example.com');

// the people in the URL type in the URL bar of the browser to get to your site

7. ENABLE WORDPRESS MULTISITE

WordPress Multisite is an impressive feature that can be useful if you need to manage multiple sites at the same time. It allows you to create a network of sites and manage them from the same WordPress panel. You can activate the function by adding the following line to your wp-config file:

define ('WP_ALLOW_MULTISITE', true);

8. TURN ON WORDPRESS CACHE

Although there are several ways to enable caching on your WordPress site, if you do not need any custom caching functionality and are satisfied with the basic WordPress cache, you can easily enable it in your wp-config file:

define ('WP_CACHE', true);

9. REQUIRE SSL LOGIN

To make your WordPress site more secure, you can force users to use SSL whenever they access your administration area. You can only use this feature if you have an SSL certificate installed on your site. The following line not only redirects administrators to the secure URL (https: //) but to all other users as well:

define ('FORCE_SSL_ADMIN', true);

10. REDIRECT NON-EXISTING SUBDOMINALS

It happens several times that a user tries to access an invalid subdomain or subdirectory in their domain. A subdomain uses the format blog.example.com, while a subdirectory follows the format www.example.com/blog. With wp-config, you can redirect all these invalid requests to the home page (or any other URL on your site):

define ('NOBLOGREDIRECT', 'https://example.com');

Alexa Rank 299000

google ranking checker

Website Page View Hit

Sales

Manager