Skip to content

Instantly share code, notes, and snippets.

@hemraj7171
Last active July 20, 2016 08:48
Show Gist options
  • Save hemraj7171/93e50afbecbfc60b4c4e726893467007 to your computer and use it in GitHub Desktop.
Save hemraj7171/93e50afbecbfc60b4c4e726893467007 to your computer and use it in GitHub Desktop.
Why wp-config.php file is so much important in WordPress
Use wp-config to better handle WordPress
1. Basic configuration
a) Database Configuration
2. Debugging
3. Security
a) Security Keys
define('AUTH_KEY', 'put your unique phrase here');
define('SECURE_AUTH_KEY', 'put your unique phrase here');
define('LOGGED_IN_KEY', 'put your unique phrase here');
define('NONCE_KEY', 'put your unique phrase here');
define('AUTH_SALT', 'put your unique phrase here');
define('SECURE_AUTH_SALT', 'put your unique phrase here');
define('LOGGED_IN_SALT', 'put your unique phrase here');
define('NONCE_SALT', 'put your unique phrase here');
Details at: http://codeseekah.com/2012/04/09/why-wordpress-authentication-unique-keys-and-salts-are-important/
b)
4. Custom file/folder structure
a) Moving wp-content folder
b) Moving plugin folder
c) Moving themes folder
d) Moving uploads folder
5. Control over plugins
a) Contact Form 7
Off the default CSS and JS
define ('WPCF7_LOAD_JS', false); // Added to disable JS loading
define ('WPCF7_LOAD_CSS', false); // Added to disable CSS loading
General format define( 'CONSTANT_NAME', 'CONSTANT VALUE' )
Advanced Options
1. Table_prefix
2. WordPress address (URL)
# If WordPress is installed into a directory called "wordpress" for the domain example.com, define WP_SITEURL like this:
define( 'WP_SITEURL', 'http://example.com/wordpress' );
# Dynamically set WP_SITEURL based on $_SERVER['HTTP_HOST']
define( 'WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST'] . '/path/to/wordpress' );
# Dynamically set WP_SITEURL based on $_SERVER['SERVER_NAME']
define( 'WP_SITEURL', 'http://' . $_SERVER['SERVER_NAME'] . '/path/to/wordpress' );
3. Blog address (URL)
4. Modify AutoSave Interval
5. Post Revisions
a)Disable Post Revisions
b)Specify the Number of Post Revisions
6. Set Cookie Domain
7. Enable Multisite / Network Ability
8. Redirect Nonexistent Blogs
9. Disable Javascript Concatenation
10. Configure Error Logging
11. Increasing memory allocated to PHP
12. Cache
13. Custom User and Usermeta Tables
14. Language and Language Directory
15. Save queries for analysis
16. Override of default file permissions
17. WordPress Upgrade Constants
a) Enabling SSH Upgrade Access
18. Alternative Cron
19. Disable Cron and Cron Timeout
20. Additional Defined Constants
21. Empty Trash
22. Automatic Database Optimizing
a)Do not upgrade global tables
23. View All Defined Constants
24. Disable the Plugin and Theme Editor
25. Disable Plugin and Theme Update and Installation
26. Require SSL for Admin and Logins
27. Block External URL Requests
28. Disable WordPress Auto Updates
29. Disable WordPress Core Updates
30. Cleanup Image Edits
References:
1. https://codex.wordpress.org/Debugging_in_WordPress
2. https://codex.wordpress.org/Editing_wp-config.php
3. https://premium.wpmudev.org/blog/wordpress-wp-config-file-guide/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment