Help us understand the problem. What is going on with this article?

Wordpressのhttps化をDB直接変更で強引に行う

More than 1 year has passed since last update.

Wordpressをhttps化したものの、一部ページ内の画像がhttpのままのため、ブラウザのアドレスバーに警告が出ていました。

1ページずつ修正するのは論外だし、プラグインを使うのも後々トラブルになりそうだったので、DBを直接弄って解決しました。

UPDATE wp_options SET option_value = replace(option_value, 'http://ドメイン', 'https://ドメイン') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET post_content = replace(post_content, 'http://ドメイン', 'https://ドメイン');
UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://ドメイン','https://ドメイン');
UPDATE wp_usermeta SET meta_value = replace(meta_value, 'http://ドメイン','https://ドメイン');
UPDATE wp_links SET link_url = replace(link_url, 'http://ドメイン','https://ドメイン');
UPDATE wp_comments SET comment_content = replace(comment_content , 'http://ドメイン','https://ドメイン');
UPDATE wp_posts SET post_content = replace(post_content, 'http://ドメイン', 'https://ドメイン');
UPDATE wp_links SET link_image = replace(link_image, 'http://ドメイン','https://ドメイン');
UPDATE wp_posts SET guid = replace(guid, 'http://ドメイン','https://ドメイン');
Why do not you register as a user and use Qiita more conveniently?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away