• DevOps
    Case Study

    How we built a resilient multi-account, multi-cloud solution for a Health Tech service provider!

    READ CASESTUDY
    icon

    24/7 DevOps as a Service

    Round-the-clock DevOps for uninterrupted efficiency.

    icon

    Infrastructure as a Code

    Crafting infrastructure with ingenious code.

    icon

    CI/CD Pipeline

    Automated CI/CD pipeline for seamless deployments.

    icon

    DevSecOps

    Integrated security in continuous DevOps practices.

    icon

    Hire DevOps Engineers

    Level up your team with DevOps visionaries.

    icon

    Consulting Services

    Navigate success with expert DevOps consulting.

  • TechOps
    Case Study

    How we built a scalable Odoo solution for a Travel Tech service provider!

    READ CASESTUDY

    WEB HOSTING SUPPORT

    icon

    HelpDesk Support

    Highly skilled 24/7 HelpDesk Support

    icon

    Product Support

    Boost your product support with our expertise.

    MANAGED SERVICES

    icon

    Server Management

    Don’t let server issues slow you down. Let us manage them for you.

    icon

    Server Monitoring

    Safeguard your server health with our comprehensive monitoring solutions.

    STAFF AUGMENTATION

    icon

    Hire an Admin

    Transform your business operations with our expert administrative support.

    icon

    Hire a Team

    Augment your workforce with highly skilled professionals from our diverse talent pool.

  • CloudOps
    Case Study

    How we helped a Private Deemed University in India, save US $3500/m on hosting charges!

    READ CASESTUDY
    icon

    AWS Well Architected Review

    Round-the-clock for uninterrupted efficiency

    icon

    Optimize

    Efficient CloudOps mastery for seamless cloud management

    icon

    Manage

    Automated CI/CD pipeline for seamless deployments

    icon

    Migrate

    Upgrade the journey, Migrate & Modernize seamlessly

    icon

    Modernize

    Simplify compliance complexities with our dedicated services

    icon

    FinOps as a Service

    FinOps as a Service

  • SecOps
    Case Study

    How we built a scalable Odoo solution for TravelTech service provider!

    READ CASESTUDY
    icon

    VAPT

    Vulnerability Assessment and Penetration Testing

    icon

    Source Code Review

    Ensuring source code security ans safe practices to reduce risks

    icon

    Security Consultation

    On demand services for improving server security

    icon

    System Hardening

    Reduced vulnerability and proactive protection

    icon

    Managed SoC

    Monitors and maintains system security. Quick response on incidents.

    icon

    Compliance as a Service

    Regulatory compliance, reduced risk

  • Insights
    Case Study

    How we helped a Private Deemed University in India, save US $3,500/m on hosting charges!

    READ CASESTUDY
    icon

    Blog

    Explore our latest articles and insights

    icon

    Case Studies

    Read about our client success stories

    icon

    Flipbook

    Explore our latest Flipbook

    icon

    Events

    Join us at upcoming events and conferences

    icon

    Webinars

    Watch our educational webinar series

  • Our Story
  • Contact Us

Interested to collaborate?

Get in touch with us!

Ready to elevate your business with certified cloud expertise? Contact us today to learn how our team can help you leverage cloud technology to drive growth, streamline operations, and enhance security.

  • AWSAWS
  • Azure CloudAzure Cloud
  • Google CloudGoogle Cloud
  • Akamai CloudAkamai Cloud
  • OVHOVH
  • Digital OceanDigital Ocean
  • HetznerHetzner
  • Kubernetes Consultancy Services
  • K8s & Cloud native Solutions
  • 24/7 Infrastructure Monitoring
  • DevOps as a Service
  • Cloud CI/CD Solutions
  • White Labeled MSP Support
  • Our story
  • Life@SupportSages
  • Insights
  • Careers
  • Events
  • Contact Us

Connect with us!


LinkedInFacebookXInstagramYouTube

aws partneraws advanced partner
SupportSages

Copyright © 2008 – 2026 SupportSages Pvt Ltd. All Rights Reserved.
Privacy PolicyLegal TermsData ProtectionCookie Policy
WordPress tweaks via wp-config.php file

WordPress tweaks via wp-config.php file

Sheldon Moor

  • 5 min read
WordPress tweaks via wp-config.php file

Generating audio, please wait...

wp-config.php file is located inside the root directory of the WordPress installation and it is created during the installation process. This file stores the database configuration of your WordPress. Here, we are going to look at some wp-config.php tweaks which become handy for troubleshooting various WordPress issues.

1. Adding Security Keys in WordPress

By default WordPress installation automatically adds security keys to your configuration file. If you feel someone may be accessing your website without proper authentication, you can then regenerate the security keys from https://api.wordpress.org/secret-key/1.1/salt/

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' );

2. Debugging in WordPress

In order to enable the debug mode, you will need to add this rule in your WordPress configuration file.

define( 'WP_DEBUG', true );

You can also turn on debugging while hiding the errors on your website and saving them in a log file instead. To do that, add the following lines to your configuration settings.

define( 'WP_DEBUG', true );

define( 'WP_DEBUG_LOG', true );

define( 'WP_DEBUG_DISPLAY', false );

This will create a debug.log file inside wp-content folder of your website and store all debugging errors and notices inside the log file.

3. Changing Site URL and Home URL

you can change the site URL and Home URL via wp-config.php file by adding the following lines:

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

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

Replace example.com with your own domain name.

4. Override File Permissions

define('FS_CHMOD_FILE', 0644);

define('FS_CHMOD_DIR', 0755);

5. Changing Post Revision Settings

Post revision feature allows you to undo changes to your posts and pages by reverting back to a previous version or an autosave. You can change the post revision settings by using the following code.

define('AUTOSAVE_INTERVAL', 120); // in seconds

Also, you can disable the post revisions feature by using the following code.

define( 'WP_POST_REVISIONS', false );

6. Changing WordPress Trash Settings

When a post is deleted it is stored on your website for the next 30 days as trash. After that time, WordPress delete them permanently. You can use the following code to change the number of days you want to keep the trash.

define( 'EMPTY_TRASH_DAYS', 15 ); // 15 days

Also, you can disable this feature by adding the below code.

define('EMPTY_TRASH_DAYS', 0 );

7. Allow Automatic Database Repair

In order to enable this feature, you need to add the following line to your wp-config.php file.

define('WP_ALLOW_REPAIR', true);

After adding this, you need to visit the following URL to optimize and repair the WordPress database

http://example.com/wp-admin/maint/repair.php

Replace example.com with your own domain name.

8. Increasing PHP Memory Limit

You can increase the PHP memory limit through wp-config.php file by using the following code.

define('WP_MEMORY_LIMIT', '128M');

9. Moving wp-content Directory

Moving wp-content directory can help strengthen WordPress security. For this, you will need to add the following code to your wp-config.php file.

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');


Replace example.com with your own domain name.

10. Use Custom User Tables

WordPress saves all user data in the tables wp_users and wp_usermeta by default. By using the below code, you can specify the table where you want your user information stored.

define('CUSTOM_USER_TABLE', $table_prefix.'my_users');

define('CUSTOM_USER_META_TABLE', $table_prefix.'my_usermeta');

11. Enable Multi-Site Network

You can enable the Multi-Site functionality by adding the following line to the wp-config.php file. 1

define('WP_ALLOW_MULTISITE', true);

12. Limiting Access to wp-config.php file

You can add the following code to your .htaccess file to limit access to the wp-config.php file.

# Protect wp-config.php

<Files wp-config.php>

order allow,deny

deny from all

</Files>

13. Changing the Default Theme

You can easily change the default theme by adding the below code to the wp-config.php file.

define('WP_DEFAULT_THEME', 'twentyeleven');

14. Disable the Theme and Plugin Editors

If you want to protect your plugin or theme files from editing by someone, you can turn off both editors using DISALLOW_FILE_EDIT as shown below:

define('DISALLOW_FILE_EDIT', true);

15. Change Uploads Folder Path

You can change the name of the “Uploads” folder to any name you want by using the following code.

define( 'UPLOADS', 'wp-content/folder' );

16. Allow unfiltered uploads for admins

define ('ALLOW_UNFILTERED_UPLOADS', true);

By default WordPress limit certain file types which you may upload and disallows the upload by giving a security warning. In such cases, you can use the above code to overcome this warning and upload the file.

17. Disable Cache and Cache Expiration

You can disable the cache by adding the below code to the wp-config.php file of the domain.

define( 'WP_CACHE' , false);

Also, you can use the below code to specify the cache expiration time.

define ( 'CACHE_EXPIRATION_TIME' , 3600);

 

wp-config.php file

  • WordPress

Installation and Configuring of Varnish Reverse Proxy with Nginx

Installation and Configuring of Varnish Reverse Proxy with Nginx
  • Sever management
logo

Installing Varnish Cache to boost Apache’s Performance

Installing Varnish Cache to boost Apache’s Performance
  • Apache
logo

Posts by Sheldon Moor

Sheldon Moor