8 Useful WordPress Configuration Tricks That You Should Know

It’s no surprise to say that WordPress is one of the most popular content management systems globally. The primary feature of WordPress that 99% of webmasters love is its multiple configuring options. 

You’re free to configure the website in thousands of ways depending on your interest and requirements. Since configuring WordPress doesn’t require much technical understanding, even beginners or non-tech guys can work on it effortlessly.

Wp-config.php or WordPress configuration file is the necessary file in the WordPress site that stores and retrieves each data on your website. It helps you to configure the website from scratch. 

In addition, it manages behind the scenes and safeguards minor to significant data of the website. Hence, it’s pretty beneficial to understand the WordPress configuration tricks and tips. The article is beneficial for beginner-level webmasters, coders, or bloggers who wish to learn more about WordPress and its configuration techniques. 

To help you get reliable knowledge about the WordPress configuration, we’ve come up with a few useful WordPress configuration tricks that you shouldn’t miss out on. 

What do you learn from this article: 

  • About WordPress configuration and the importance of configuring WordPress sites?
  • Best practical WordPress configuration tricks and tips
  • Bonus section with less known configuration tricks and many more. 

So, without any further ado, let’s dive in. 

Understand WordPress Configuration 

If you’re using popular hosting platforms like Bluehost, Hostinger, Siteground, etc., you might have installed WordPress with just a single click. That’s why most people perhaps don’t know what exactly a wp-config.php or WordPress configuration file is. 

In general, WordPress holds a powerful configuration file, namely wp-config.php, in its root directory. The file contains:

  • The essential WordPress settings.
  • Security data.
  • Other data related to your website. 

Usually, the advanced or professional webmasters use this file to fix WordPress errors, enhance security features, and optimize the site. Since a minor change or editing mistake in the wp-config.php file changes the site’s overall structure, it’s important to create backups before using this file. 

Now, here comes the question- Is it essential to configure the WordPress site or edit the wp-config file? Skip to the next section to find out the precise answer to this question. 

Is It Necessary To Configure WordPress? 

Well, if you’re confused about whether to configure WordPress or not, here’s the simple answer. Yes, it’s significant to configure the WordPress site to improve its speed, user-friendliness, or efficiency. 

If the WordPress configuration file is edited correctly, it boosts the website performance, resolves minor to major website functionality complexes, and enhances the website speed. 

However, one should take utmost care while editing the wp-config file as it changes the entire website for minor code changes in the root directory. Hence, experts suggest creating a backup before directly editing the WordPress configuration file. 

To make your configuring process hassle-free and smooth, here are the few best tips and tricks that you should follow. 

Practical & Efficient WordPress Configuration Tricks 

Here are the eight efficient WordPress configuration tricks to use while editing the file. Read carefully and play with the root directories of WordPress like a pro. 

Basic Configuration WordPress Settings 

During the installation of WordPress, if the configuration file(wp-config.php) is absent, it asks you to create the file by filling the form with the required details. In general, WordPress saves the settings and enters information by default. Sometimes, WordPress fails to automatically save the data and generate configuration files. In such cases, you should add it manually by following a series of steps as mentioned below.

  • Initially connect the WordPress website taking the help of an FTP client. Then, rename the file “wp-config-sample.php” to “wp-config.php.” 
  • After that, it creates a WordPress configuration file. Now, you go to the file and edit it based on your requirements. Before that, you should add database information. 
  • To add it, change the below-given lines carefully. 

define(‘DB_NAME’, ‘database-name’);

define(‘DB_USER’, ‘database-username’);

define(‘DB_PASSWORD’, ‘database-password’);

define(‘DB_HOST’, ‘localhost’);

  • Finally, save the changes and upload it on the server.

Add Security Keys

The security keys act as a robust protective layer preventing bugs, malware, or other online malware practices. Usually, these keys are added to the wp-config.php file during the WordPress setup process. 

However, you can also create security keys to prevent unauthorized users from accessing your website. Moreover, once you’ve changed the security keys, it prevents the logged-in users from accessing the website. 

Change WordPress Trash Setting 

Trash is a WordPress feature that stores the deleted files, posts, comments, or pages. It’s often called the recycle bin, where you can always restore the deleted data within 30 days. However, after a month, WordPress deletes the files forever. 

By editing the WordPress configuration file, you can even change the WordPress trash feature’s time frame and behavior. 

Use the simple code mentioned below to decrease the trash files time limit from 30 to 15 days.

define( ‘EMPTY_TRASH_DAYS’, 15 ); // 15 days

To altogether disable this feature, you can use the following code. 

define(‘EMPTY_TRASH_DAYS’, 0 );

The zero in this code means that WordPress doesn’t ask you for confirmation while deleting the files. Once you delete the post or page by mistake, it’s deleted forever and cannot be restored. 

Although it seems to be a useful feature for a moment, it costs you more once you delete the most significant posts or pages. So, it’s always recommended not to disable the trash feature completely. 

Add FTP/SSH Constants 

Most hosting platforms help you install themes, plugins or upgrade them in the WordPress dashboard or admin panel. However, there are a few hosts where you should upgrade or install plugins by adding the FTP or SSH constants. 

So, use the below-mentioned code lines to remove the requirement of SSH or FTP each time you upgrade theme, plugins, site, or install new themes and plugins.  

// forces the filesystem method: “direct”, “ssh”, “ftpext”, or “ftpsockets”

define(‘FS_METHOD’, ‘ftpext’);

// absolute path to root installation directory

define(‘FTP_BASE’, ‘/path/to/wordpress/’);

// absolute path to “wp-content” directory

define(‘FTP_CONTENT_DIR’, ‘/path/to/wordpress/wp-content/’);

// absolute path to “wp-plugins” directory

define(‘FTP_PLUGIN_DIR ‘, ‘/path/to/wordpress/wp-content/plugins/’);

// absolute path to your SSH public key

define(‘FTP_PUBKEY’, ‘/home/username/.ssh/id_rsa.pub’);

// absolute path to your SSH private key

define(‘FTP_PRIVKEY’, ‘/home/username/.ssh/id_rsa’);

// either your FTP or SSH username

define(‘FTP_USER’, ‘username’);

// password for FTP_USER username

define(‘FTP_PASS’, ‘password’);

// hostname:port combo for your SSH/FTP server

define(‘FTP_HOST’, ‘ftp.example.org:21’);

Remember that you should use your FTP host data in place of “ftp.example.com.” Since we used WordPress, we’ve taken the WordPress path. In your case, you should use your FTP host data. 

Change Post Revision Features and Settings 

If you’re familiar with WordPress, you might’ve noticed its undo-redo features for posts and pages. It’s one of the effective post revision settings that help you restore the previous version articles. 

If you want to change this feature, it’s easier to do using the configuration file. A few post revision features and settings that you could use in WordPress are mentioned below. All you need to do is just copy the code and change the timing based on your requirements. 

define(‘AUTOSAVE_INTERVAL’, 120); // in seconds

Have you ever observed that for a few posts, there will be numerous post revisions? However, use the below-given codes if you’d like to limit or disable the post revisions features completely. 

For limiting the post revisions- 

define(‘WP_POST_REVISIONS’, 10);

For disabling the revision feature completely-

define( ‘WP_POST_REVISIONS’, false );

Usually, disabling posts revision isn’t recommended at all by the experts. If you want, you can limit the revisions. 

Ensure Database Repairs Automatically 

Did you know WordPress has a special feature that automatically repairs and improves the performance of a database? Usually, this feature is turned off. Hence, to activate the feature, you should add the following code in the WordPress configuration file. 

define(‘WP_ALLOW_REPAIR’, true);

Once you add the above code, go to the below-given URL to prepare and boost the database performance. 

Secure Configuration File 

Since the WordPress configuration file contains essential data, it’s vital to secure it, preventing access to various webmasters and hackers. Although the file is situated in the WordPress root directory, it’s pretty easy to take out from the public-HTML directory. Once you take it out from the public directory, others cannot access the file.

To prevent the user access to this file, go to the .htaccess file and copy the below-given code. 

# Protect wp-config.php

<Files wp-config.php>

    order allow,deny

    deny from all

</Files>

Custom User Tables 

By editing the WordPress configuration file, you can store the user data in specific tables. In general, WordPress stores each user data in tables such as “wp_users” and “wp_usermeta”. Using the code below, you can control these features by setting specific tables to store the user data. 

define(‘CUSTOM_USER_TABLE’, $table_prefix.’my_users’);

define(‘CUSTOM_USER_META_TABLE’, $table_prefix.’my_usermeta’);

These are the few most essential WordPress configuration tricks that you should know. However, scroll to the next section if you’d like to enjoy a few more tips and tricks.

Bonus: More Tips & Tricks Every Beginner-level Webmasters Should Know 

Whether you’re a beginner or an advanced webmaster, here are the few most essential WordPress configuration tips that you shouldn’t miss out on. 

  • Enhance Memory Of The Php 

The exhaustion of PHP memory majorly causes the highest WordPress errors. SO, it’s vital to increase or enhance the PHP memory for the smooth functioning of the WordPress site. Use the below-given code to increase the PHP memory without a hitch. 

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

  • Edit Table Prefixes In The WordPress 

Editing the table prefixes enhances the security and ensures the premium protection of your site. It prevents malware and bugs from destroying your website. Copy the below-given code to edit the table prefixes. 

$table_prefix = ‘wp_’;

  • Change WP Url 

This is another most significant thing to remember. You can change the WP URL in the wp-config.php file by adding the below-given code lines. 

define(‘WP_HOMEURL’, ‘your website’s URL’);

define(‘WP_SITEURL’, ‘your website’s URL’);

  • Activate Site Caching 

If you want to improve your overall site’s performance, activate the site caching. For This, you’ll need the following code. 

define(‘WP_CACHE’, true);

  • Increase Security By Moving The WP-Content Directory 

Experts say that moving the WP directory increases website security. So, to move the file, use the given code to the wp-config.php. 

define( ‘WP_CONTENT_DIR’, $_SERVER[‘DOCUMENT_ROOT’] . ‘/blog/wp-content’ );

define( ‘WP_CONTENT_URL’, ‘http://example/blog/wp-content’);

define( ‘WP_PLUGIN_DIR’, $_SERVER[‘DOCUMENT_ROOT’] . ‘/blog/wp-content/plugins’ );

define( ‘WP_PLUGIN_URL’, ‘http://example/blog/wp-content/plugins’);

Make sure to change the “example.com” with your website domain name. 

  • Activate Multisite Network

WordPress has a feature to set up a multilingual site without installing WordPress repeatedly. 

However, this feature is usually deactivated. If you want, you can activate this feature by using the below code. 

define(‘WP_ALLOW_MULTISITE’, true);

Key Takeaways 

WordPress is one of the popular CMS. Hence, it’s vital to understand each aspect of WordPress to improve the overall site’s performance. Especially, wp-config.php is an important file that stores each bit of your site’s data from post information to security data. 

So far, we have discussed the significant 8 WordPress configuration tricks and tips that help you boost website performance. Whether you’re a blogger, webmaster, or developer, these are the basic functionalities to understand. 

It is relatively beneficial to learn simple tips and tricks about WordPress configuration so that you can change the website to match the content. However, if you encounter any trouble while trying to configure the website, make sure to reach out to JustHyre. JustHyre is the perfect option for theme installation, configuration, web designing, and plugin development.