WP novice website 28: Wordpress website changes the domain name, modifies the image address in batches, and Wordpress article publishing skills

5 minutes
two hundred and eighty-four
zero

Generally, for the webmaster of a wordpress website, he will not easily change the domain name of his website. Because the domain name is equivalent to the ID number of a wordpress website. Users can find your website by using this domain name. Another reason is that if the domain name is changed, and if the WordPress website space is domestic, it will take a lot of time to re record the new domain name.

However, there are always some special circumstances. For example, our WordPress website was demoted by the search engine due to some illegal operations, and even no longer included our website. In this case, we may need to change the domain name of our wordpress website. At this time, another situation may occur: when inserting an article image, the image address written to the wordpress database may be an absolute path address, that is, the image address with the domain name (as shown below).

At this time, if the domain name of our wordpress website is changed, the image addresses of these absolute paths will not be opened in the browser after the original domain name is stopped. So, at this time, as the webmaster of WordPress, what should we do? There are only two methods. Either upload pictures again for each article, or modify the image address of the article on the WordPress website in batches - change the original domain name to the current new domain name.

Obviously, the first method - uploading pictures again for each article is not feasible. If the number of articles on our WordPress website is small, just a few or more than ten, it's easy to say. If our website has thousands of articles, even tens of thousands of articles, and the pictures are uploaded again one by one, isn't that to blame?

Therefore, the second method is our correct way. Then, the problem arises again. How to batch modify the domain name of the article image address of our WordPress website? The image address is stored in the wordpress database. Can we modify the address of the article image in batch through the operation of the wordpress database? The answer is yes.

Earlier, we introduced the phpmyadmin database management tool (of course, you can also use other database management tools to operate). Let's introduce how to use phpmyadmin to batch modify the image addresses of articles on the WordPress website.

Method 1: SQL code to batch modify the article image address.

Step 1: phpmyadmin logs in to your wordpress database.

If you have multiple websites on the same server, you may have multiple website databases after logging into phpmyadmin, as shown below:

Be sure to find the database of the WordPress website where you want to change the domain name. If you find it wrong, it will be terrible.

Step 2: Select the wp posts data table.

After finding your WordPress website database, click the "wp posts" data table on the left (as shown in the figure below). This table is the table used by WordPress to store article information. The main information of all articles on WordPress website is stored in this table.

Step 3: click "SQL" in the top menu;

Click the "SQL" menu in the above figure to enter the SQL statement interface, as shown below:

Step 4: Enter the SQL statement in the input box.

Enter the following SQL code in the input box with the red icon on the top, and then click the "Execute" button.

UPDATE wp_posts SET post_content=replace (post_content, old domain name, new domain name)

Method 2: Use the "Find and Replace" function to replace in batches.

Step 1: phpmyadmin enters the wp posts data table.

The method is the same as above, so I won't say much here.

Step 2: Click "Search" in the top menu to enter the search interface, as shown below:

Step 3: Click the "Find and Replace" button. Enter the interface as shown below:

Step 4: Enter "old domain name" in the "search" input box, and enter "your new domain name" in the "replace with" input box, and select post_content (article content) in the field. Then click the "Execute" button.

Through the above two methods, you can implement batch modification of article image addresses on the WordPress website. However, no matter which method you use to modify the domain name in the image address, you'd better back up the database of the WordPress website before modifying - in case of loss caused by modification failure. The same sentence: the modification is risky, and the operation should be careful.

This article is written by: Chief Editor Published on Software Development of Little Turkey , please indicate the source for reprinting: //hongchengtech.cn/blog/1971.html
Kuke_WP editor
author

Related recommendations

1 year ago (2024-02-20)

Industry Fit! Preferred element of WMS warehouse management system, wms warehouse software

Enterprise managers often think that warehouses are inefficient, high cost places, and belong to heavy asset operations. With the development of enterprise business, if the warehouse needs to be expanded in traditional ways, the cost is relatively high. At the same time, it also faces problems such as lack of operating experience. In the operation link, the process of warehouse, allocation, human resource matching and management is very complicated, and the team's professional ability is also highly required
seven hundred and eighty-three
zero
1 year ago (2024-02-19)

Supply chain billing system management (I): system overview, what are the supply chain management fees

In recent years, with the continuous development of e-commerce industry and increasing business, everyone has started to distribute goods online, and the supply chain billing system needs to manage more and more things. How to manage the billing system? The author summarizes some contents about settlement based on his own practical experience, hoping to enlighten you. After working on the warehouse management system for several years, I was transferred to work as a supplier
five hundred and fifty-six
zero
1 year ago (2024-02-19)

Multi merchant system management - store background design, what is the meaning of multi merchant classification

Simply understood, multi merchants are a large mall. The platform can manage merchants who settle in the mall. The merchants who settle in the mall have independent backstage. They can log in and add goods to the shelves by themselves, manage stores by themselves and other information functions. Then how to design the backstage of the store? Let's see the author's sharing. I hope it can help you. 1、 Introduction The backstage of the store is an important part of the e-commerce platform
six hundred and forty-eight
zero
1 year ago (2024-02-19)

Jiangyang District of Luzhou City took the lead in the city's full coverage training on domestic waste classification management regulations, Luzhou waste treatment

Source: Original Draft On January 10, the People's Congress of Jiangyang District, Luzhou City and the District Government jointly carried out a training on the regulations of the Regulations on the Classified Management of Domestic Waste in Luzhou City (the Regulations for short), and invited Lei Zhengyun, the chairman of the Legislative Affairs Committee of the Municipal People's Congress, to give a live lecture, so as to guide the comprehensive and systematic grasp of the contents and legal functions and responsibilities of the Regulations, deeply understand the specific specifications of the Regulations, and quickly set off
three hundred and seventeen
zero
1 year ago (2024-02-19)

Simeng CMS (smcms) content management system, Simeng Central Primary School

SMCMS (Simon CMS) is a content management system developed based on the microbee http rapid development framework. Product development follows the concept of simplicity, security, high concurrency and efficiency. Enterprise level web content management software for high-end users is designed to help users solve the increasingly complex and important web content creation, maintenance, publishing and response
three hundred and sixty-one
zero
1 year ago (2024-02-19)

Does the website have to install a content management system?, What apps are needed to install software on the website

1: The role of the website is to let companies or enterprises display their own windows, but also to let more customers or potential customers know their work and products. Through the website, customers can understand their products and services more intuitively, and can also provide more services to meet customer needs. 2: The role of the content management system The content management system can help
four hundred and fifty-six
zero

comment

0 people have participated in the review

Scan code to add WeChat

contact us

WeChat: Kuzhuti
Online consultation: