Closed. This question is off-topic. It is not currently accepting answers.admin管理员组文章数量:1430519
Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.
Closed 6 years ago.
Improve this questionMy client's website is moved from http
to https
, and I have updated most of the URLs using queries in phpMyAdmin, but I have been unable to update shortcode URLs.
I have used the following query to replace the URLs in post_content
, but it has no effect on the shortcode URLs:
UPDATE `wp_posts`
SET post_content = REPLACE(post_content, 'src="', 'src="')
WHERE post_content
LIKE '%src="%';
Update:
The following wp-cli
command produced a single match in the wp_yoast_seo_links
table:
wp search-replace '' '' --dry-run --skip-columns=guid
I also tried --all-tables
in the command, and it produced more results, but only for Wordfence and other security tables.
Any ideas on why it is not finding URLs placed via short codes?
Closed. This question is off-topic. It is not currently accepting answers.Note: Shortcodes inserted using DIVI plugin.
Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.
Closed 6 years ago.
Improve this questionMy client's website is moved from http
to https
, and I have updated most of the URLs using queries in phpMyAdmin, but I have been unable to update shortcode URLs.
I have used the following query to replace the URLs in post_content
, but it has no effect on the shortcode URLs:
UPDATE `wp_posts`
SET post_content = REPLACE(post_content, 'src="http://example', 'src="https://example')
WHERE post_content
LIKE '%src="http://example%';
Update:
The following wp-cli
command produced a single match in the wp_yoast_seo_links
table:
wp search-replace 'http://example' 'https://example' --dry-run --skip-columns=guid
I also tried --all-tables
in the command, and it produced more results, but only for Wordfence and other security tables.
Any ideas on why it is not finding URLs placed via short codes?
Share Improve this question edited Apr 18, 2019 at 15:56 Fayaz 9,0172 gold badges33 silver badges51 bronze badges asked Apr 16, 2019 at 18:04 Mike HermaryMike Hermary 2193 silver badges11 bronze badges 5 |Note: Shortcodes inserted using DIVI plugin.
1 Answer
Reset to default 3You should try running WP-CLI's search-replace
command.
$ wp search-replace 'http://example' 'https://example' --all-tables
But you said these URLs are placed from a shortcode? Then you need to find out what this shortcode actually is doing. As it not necessarily has saved the URLs to the database. Maybe it's a setting in the shortcode and then the URL gets generated accordingly? You could also dump your database (maybe with WP-CLI again: $ wp db export test.sql
) and open that with a text editor to see if you still can find the old URL in there.
本文标签: Need MySQL Query or WPCLI command to updates old URLs in Shortcodes
版权声明:本文标题:Need MySQL Query or WP-CLI command to updates old URLs in Shortcodes 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745555544a2663164.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
wp search-replace 'http://example' 'https://example'
? – norman.lol Commented Apr 16, 2019 at 18:10https
. So I suggest you check the shortcode settings. – Fayaz Commented Apr 18, 2019 at 16:03