2

I am trying to change all images links from http to https, is it possible doing that on a batch query working on the whole database? How?

Moreover my provider made a mess adding an "s" to https getting useless and wrong "httpss" ! So I must revert them from httpss to https.

Please help, many thanks.

4
2

I should think that you can use phpAdmin Find and Replace where you find "http://www.example.com" and replace with "https://www.example.com". This should handle all internal linking (if blog, then internal linking as well as images, etc.). It would not cover relative addressing like "//www.example.com". In the case of Wordpress, this would be done on the wp_posts table, post_content column.

2

you could use https://github.com/interconnectit/Search-Replace-DB. This is a great tool to find and replace in db, you just need to copy the srdb folder to root of your site( where your wp-config.php is), then open it :

yourdomain.com/srdb

and then find and replace the strings in your db

for replacing use like this

httpss: ==> https:              //for those which have ss
http:   ==> https:              // for new one

adding

:

to your replace statement prevent mistake

1

Do not change these URLs in database. The protocol part should be 'http'. When 'https' request is being made, then first four characters of the URL is replaced by 'https', automatically. If URL from database starts with 'https' then result will be 'httpss'!

1
  • I acknowledge your good advice, but it's very odd that some "want be" technicians from my provider told me the best way is working directly on the database! I cross my finger waiting them to repair that mess! – passegua Apr 16 '17 at 18:41
1

You can use a very good search/replace plugin that I'm using last year - Better Search Replace

It's working very good. Be sure you'll create the DataBase backup before. I never had problems with this plugin, but you have to be sure, you have the DataBase copy in any case.

1
  • Many thanks for pointing to that plugin, I'll keep in mind whenever I'll need it. – passegua Apr 18 '17 at 16:42

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.