9 Awesome WordPress Engine Configuration Tips

From this tutorial you’ll learn how to configure WordPress engine to enhance website performance, extend database functionality and improve your data secureness. To learn more about the subject, please, proceed with reading our awesome WordPress engine configuration tips!

Detecting Database Host

You can easily detect the database host using wp-config.php file, which is located in WordPress directory.
Access wp-config.php file and open it in any code editor that is convenient for you.
Locate the following line of code, that detects the database server host.

https://gist.github.com/Shininglow/92aa1231a0f77370c0839d692c7d2ed3

Repairing Database Issues

There is an option that allows to repair and optimize database using WordPress. WordPress CMS will automatically detect the issues with the database and fix them. It will increase website performance.

We strongly recommend to ask your hosting provider for more information on the subject.
Add the following line to wp-config.php file to use this feature.

https://gist.github.com/Shininglow/e5a5c324ae64b2437173cd4439ce4132

Fixing Update Problems

If you’re facing problems with updates you might need to define the filesystem method to use on the server. The method can be direct, ssh2, ftpext or ftpsockets. Add the following line of code to wp-config.php file.

https://gist.github.com/Shininglow/27269bc288e5dbda986d9ffbfea87943

Finding Errors and Deprecated Functions

If you’re a developer and you need to locate errors and deprecated functions, you can do it as follows. Locate the ‘WP_DEBUG’ line of code and apply the following changes.

Note, that by default the function is false, and you have to enable it in the development mode.

https://gist.github.com/Shininglow/609f3623cbdd33e8f55daedbe522b0e4

Reducing the Number of Database Queries

When you define your site address and WordPress address under Settings > General tab, this information is added to the database, and every time you need this information WordPress runs a database query.
Add the following line of code to reduce the number of these queries.

https://gist.github.com/Shininglow/091811f8423a6cd9e286dd3a73307740

Overriding File Permissions

To override file permissions add the following line of code to the wp-config.php file.
This method proves to be useful when your host has restrictive permissions for user files.

https://gist.github.com/Shininglow/1bf6475eca3f865da5d3e8fac1b7e2a4

Setting Custom Post Backup Time

As a rule, WordPress saves post content every 60 seconds, but you can set your own time limit. To do it add the following line of code to wp-config.php file.

https://gist.github.com/Shininglow/3171f3595480a673c126ff0c4ba468d0

Setting Custom Trash Cleaning Time

Usually, the files in the Trash bin are deleted every 30 days. But you can change the time period to your custom one. To do it just add the following line of code to wp-config.php file.

https://gist.github.com/Shininglow/6796b72c3abec1727a1356005138e0f8

In the case, you need to disable the trash bin, add the following line of code.

https://gist.github.com/Shininglow/93309b8c31929e5ceacaf3089326ed42

Solving “Memory Exhausted” Error

If you get  Fatal error: Allowed memory size of X bytes exhausted (tried to allocate Y bytes) error, then you need to increase the memory limit. To do it add the following line of code.

https://gist.github.com/Shininglow/80aede4d999ce842093de9aefa4a7e4a

This tutorial is based on Car Dealer Responsive WordPress theme.