How to fix Mixed content for wordpress plugin and themes, my images already served with https

i also test with https://www.whynopadlock.com/

3 Answers 3


For this you will need to use a plugin like Better Search Replace to replace http://yoursite with https://yoursite

WordPress saves URLs in the database absolutely. So if you at one point in time had the site with http and then changed to use https WordPress would still have the http urls saved in the database.

WordPress doesn't automatically update its database when a site switches to https to fix urls.

Better Search Replace , once installed will let you do a dry run to test out the replacement to see if it will work without accidentally messing up your database. Once you are satisfied with the results, run the replacement for real and that should do the trick.

Of course using a search and replace plugin is only one of many ways to alter the database, but it's one I find fast and effective.

NOTE: Back up your website first.!!!

  • 1
    While this is sound for some cases, it's uncommon for plugin and theme asset URLs to be database-stored.
    – Rarst
    Aug 22, 2017 at 16:21
  • Good point. This wouldn't work for static file calls if they are absolute URLs. In that case of course you'd have to search/replace the theme itself. Though for compatibility, it's unwise for any theme or plugin developer to hardcore URL paths.
    – Ian
    Aug 22, 2017 at 16:25

WordPress core and extensions (should) rely on API functions to produce and enqueue assets at accurate location and protocol.

Since your case seems to be about these, rather than URLs stored in content, there are two general possibilities:

  1. Code in extensions doesn't use API or uses it incorrectly, producing invalid URLs. Typically this is something that should be fixed upstream by extension’s developers.

  2. Your WP instance and/or server are configured incorrectly, causing API to produce invalid results, based on that invalid configuration. This is hard to guess and needs troubleshooting of specific install, going over settings and trying to examine specific relevant code and its results.


I recommend you to edit your wp-config.php with https urls first. Add these lines after mysql credentials:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.