Speed up your WordPress site with 2 lines of code

In your WordPress Settings, you specify the WordPress address and the site address. Those are added in your database, and every time the developer calls it in the template, it is running a database query. These WordPress settings were introduced to override the database values without changing them :

define (‘WP_HOME’, ‘http://www.mysite.com’);
define(‘WP_SITEURL’, ‘http://www.mysite.com’);

By adding these in your wp-config.php, you are reducing the number of database queries thus increasing your site’s performance.

  • If you use ssl certificates, use https
  • If your default url is not-www, then use http://mysite.com

Leave a Comment