Welcome
We've been working hard

Detailed tutorial on how to batch replace picture paths in WordPress

Website relocation is no stranger to website builders, and WordPress relocation is no exception. When we move our WordPress blog or move, we sometimes need to replace the image path in WordPress articles to solve the problem of not displaying images. So how to solve this problem? WordPress tutorial network to teach you how to batch replace the image path!

 

Why do you replace image paths in batches

1. Change website domain name
Many websites have randomly selected a website domain name at the initial stage of construction. When updating articles, images are uploaded with their own website domain name in many cases. Therefore, once the domain name is changed, the image link address will become invalid.

2. The address of the external link graph bed is invalid
Sometimes, in order to save website space, or update articles without too much consideration, a unified external map bed chain is used, such as the secondary domain name of Qiniu cloud storage. Once the external link of the map bed fails, it may be burglarized, or the secondary domain name may be changed, then the link address of the image will become invalid.

3. The picture address is invalid for other reasons
In the above three cases, if you want to change the image link address of an article, do not modify it in batches, but manually modify it. It doesn't matter if there are only ten or eight articles. Otherwise, it will be difficult to update the image address.

 

Batch replacement of database commands

Update the image link addresses in all articles through MySQL operation command statements.

It should be noted that the novice must back up the database before operation, so as to avoid mistakes in operation. How to back up a database? I will not go into details about searching related tutorials on the Internet.

Log in to your own database management background, log in to the PHPMyadmin database management software, and log in to the background to select the corresponding database wp_posts table, as shown in the following figure:

Execute the SQL command line operation and enter the command line UPDATE wp_posts SET post_content=REPLACE (post_content, 'old web address',' new web address');? Examples are as follows:

 

UPDATE statement command description

UPDATE table name SET field=REPLACE (field, 'content to be replaced', 'replacement value');

Quotation marks are not required for table names and field names, but for the content to be replaced and the value to be replaced, because they are string types, attention should be paid here.

Finally, the batch replacement of pictures in WordPress articles is completed.

Like( zero ) Reward
Do not reprint without permission: New Start Blog » Detailed tutorial on how to batch replace picture paths in WordPress


Follow the public account "New Start Software Steward"

Get the latest network resources and cracking software!
Play with all kinds of software

comment Grab the sofa

You must log in before commenting!

 

Reward the author of the article if you think it is useful

Thank you very much for your reward, we will continue to give more high-quality content, let's create a better online world together!

Scan Alipay and reward

Scan WeChat and reward