L
L
LR92020-07-22 15:15:59
WordPress
LR9, 2020-07-22 15:15:59

How to change http data to https in wp?

Best time of the day!

Situation: we do not set https due to mixed content.
Reason: images registered in css have values ​​not https but http.
What was done.
a)
Plugins:
1 Velvet Blues Update URLs
2 Really Simple SSL
3 Better Search Replace
None helped.
b)
A redirect was added to .htacces
c)
The main protocol of the site was changed from HTTP to HTTPS "Settings → General in the WordPress admin panel. "
=total:
did not help.

Help please, of course you can handle it, but you still need the advice of a guru, maybe there is a way.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Dmitry, 2020-07-22
@LR9

So you can replace http://olddomain.comwith https://olddomain.comin all css files in the current and subdirectories:

find . -name "*.css" -exec sed -i 's|http://olddomain.com|https://olddomain.com|g' {} \;

The command must be run from the theme directory. Replace olddomain.com with your domain. And just in case, before doing it, make a backup of the files.

M
mipfikus, 2020-07-22
@mipfikus

You need to change it in the database, here is the SQL query:

UPDATE wp_posts SET guid = REPLACE (guid, 'http://olddomain.ru', 'https://newdomain.ru');
UPDATE wp_posts SET post_content = REPLACE (post_content, 'http://olddomain.ru','https://newdomain.ru');

In phpMyAdmin, you can insert it here:
5f182f25936be752364401.png
upd.
Didn't understand the question the first time. If it is written in css, then change it in css.

D
Dim Boy, 2020-07-22
@twix007

SSL Mixed Content Fix

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question