This is happening because WordPress saves URLs in content absolutely by default (meaning that it’s actually got your urls saved as http://example.com in the database). So to fix this you’ll want to run a search and replace in your database to fix those errors.
I like to use the plugin Better Search Replace because it has a nice feature to let you try out your search/replace as a dry run to test. There are lots of other search/replace methods, and you could also make the changes in PhpMyAdmin, but I’ll just put instructions for using the Better Search Replace plugin.
Assuming you are using Better Search Replace:
- BACK UP YOUR DATABASE! Always always always. Use whatever tool you want to do this (UpdraftPlus, or dump (NOT DROP) it from PhpMyAdmin or straight from MySQL are all options).
- Head to tools > Better Search Replace
- Add the non SSL version of your website to the search field http (eg.
http://example.com
) and the SSL version of your website to the replace field - Select the tables you want to update. Most likely all you’ll need is the
wp_posts
andwp_postmeta
table but you can add them all if you like. Just know that it could take longer and time out depending on your server specs. - Do a dry run to make sure that it works
- If it works, then uncheck the dry run option and run it for real.
- Check your website to verify the errors have been fixed. If they have, awesome!
Note: Any time you search/replace there’s a chance you could cause massive problems to your website. Hence step one, back up your website. If something goes wrong, you have a way to restore your data.