Skip to main content

First thing first, You can define your https site in wp-config.php (located in your wordpress root folder).

To do this, simply edit your wp-config.php file by adding the following lines above the “That’s all, stop editing!” comment:

define( 'WP_HOME', 'https://example.com' );
define( 'WP_SITEURL', 'https://example.com' );

These lines take precedence over the values of the siteurl and home options in your database. Once added, check out a few pages on the site. You might notice some mixed content warnings due to images or other files loading over HTTP, but we’ll fix those next.

Running a search/replace with WP Migrate DB Pro

Now that we’ve got the main Site URL and home URL switched over to HTTPS, we’ll still need to update the rest of the content in the database to use the HTTPS versions of the URLs.

We can do this with the WP Migrate DB Pro Find & Replace feature:

WP Migrate DB Pro Find & Replace settings

As you can see, I’ve added the “http://“ version of the URL In the “Find” column, with the “https://“ version in the replace column. I’ve searched in all tables, and checked the “Backup the database before running the find & replace” option – this ensures that we can roll back if we need to later.

In the advanced options, I left the “Replace GUIDs” option unchecked – this is important if your website has already been live because updating the GUIDs could make any posts or pages show up as new in feed readers. I unchecked the “Exclude transients” option in case there are any transients (temporary options) in the database that rely on the site URL.

Next Steps

With the find & replace finished and all URLs in the database updated, you should remove the updates you made to your wp-config.php file and check a few pages on the front end of your site to make sure that everything is working as expected.

If the website isn’t marked as secure (usually with a green padlock icon in Chrome or Firefox) by your browser, you’ll want to check for any mixed content warnings. These happen when the page is HTTPS but there are some assets loading over HTTP.

You can usually spot these sorts of warnings by heading over to your browser’s javascript console and looking for any errors about content being loaded over HTTP:

Mixed content warning in console

If you do have these errors, the most common culprit is theme or plugin files or some images – sometimes links to theme or plugin assets can be hardcoded and will need to be corrected.