WordPress configuration file wp-config tweaks – you might never know

Today we will discuss about some unusual wp-config tweaks. It will help to make your website secure, to add some special configuration on your demand. I will try to keep it simple and short. If you have any question, feel free to ask in our general support forum: https://duogeek.com/support/forum/general-wordpress/

So, let’s start-

1. Move the configuration file:
I assume your server root is /var/www/htdocs/. So, wp-config file is in/var/www/htdocs/wp-config.php. You can move the file to one folder up, like /var/www/wp-config.php. Notice, outer world has access to /var/www/htdocs/ folder but no /var/www/ folder. So, wp-config.php is totally unaccessible from outside. And to do so, you don’t have to write one single line. WordPress looks for one step up by default, when the config file is not in root. to make more secure, you can move the file to anywhere else. But then, in wp-config.php file in root, you have to show the path.

For example, in /home/user/ folder you create a file called my-config.php. Copy all the content from wp-config.php and paste into my-config.php. And now, include the my-config.php in wp-config.php file.

/var/www/htdocs/{all wordpress files}

So, in wp-config.php file the code should be:

2. Rename wp-content directory location

3. Define new plugin directory

4. Change Mu-Plugins Directory

5. Change Default Theme

6. Block editing themes and plugins from admiin

7. Disallow themes and plugins updating

8. Set akismet key for multisite network

9. Disable Post Revisions

10. Set number of revisions

11. Force SSL Login (if you have SSL enabled)

12. Enable debug but don’t display rather log

13. Disable automatic updates

14. Enabling the “Trash” Feature for Media Files

15. Allowing Unfiltered WordPress Uploads for Administrators

16. Override File Permissions

17. Auto Save Interval

18. Increase PHP Memory Limit

19. Custom User / UserMeta Tables

20. Setup PHP Ini Settings

21. Use a Cookie Domain

22. Disable JavaScript concatenation

There are a lot more! If you study, you will find yourself 🙂

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

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