How to change internal links from http:// to https:// across WordPress website

If you switched your WordPress website to secure SSL URL, it may still have some internal links in the settings or posts which refer to old http:// addresses. Here is a quick way to fix them all.

Once you have your WordPress website changed to use secure URL (https://), there may be an issue with old non-secure links inside the posts or configuration.

Those links may cause browser to block loading images, scripts, styles, and also creating extra redirect or confusing search engines with inconsistent URLs on your website.

Doing search and replace directly in the MySQL database may help, but problem is that WordPress stores some configuration as a serialized PHP arrays and simple string replace will actually break the setting, because URL length changes when you add that extra ‘s’ to ‘http’.

Simple and proven method I use is free WP Migrate DB plugin.

Install plugin, activate it, go to the Tools -> MigrateDB in WordPress admin, choose Find and Replace option and just enter your old and new URLs there. Done!

Important tip: backup your website (especially database) first – there is always some risk breaking WordPress website when making changes to database.

Here is a quick screenshot from the plugin page:

Leave a Reply

Learning WordPress development?

Subscribe and never miss a post about WordPress themes and plugins coding techniques, WordPress website development workflow and best practices.