Home >CMS Tutorial >WordPress >What is the SQL statement for modifying the ID of an article in WordPress?

What is the SQL statement for modifying the ID of an article in WordPress?

藏色散人
藏色散人Original
2020-01-02 09:50:052440browse

What is the SQL statement for modifying the ID of an article in WordPress?

What is the SQL statement for modifying the ID of an article in WordPress?

When I was writing an article a few days ago, the ID jumped directly from 146 to 148. The IDs that have been processed by WordPress will be automatically continuous. Let me share with you how to change the article ID to 148. SQL into 147, friends who have similar problems can refer to it

Recommended: "wordpress tutorial"

The article was updated in April, The article ID stayed at 146. I was busy with exams in May and didn’t write a single article. As a result, when I was writing an article a few days ago in June, the ID jumped directly from 146 to 148. I don’t know why. My WordPress has done some processing. The IDs will be automatically consecutive. Open the database and change the article ID of 148 to 147. The complete SQL statement is as follows:

The code is as follows:

update wp_posts set id = 147 where id = 148; 
update wp_term_relationships set object_id = 147 where object_id = 148; 
update wp_postmeta set post_id = 147 where post_id = 148; 
update wp_comments set comment_post_ID = 147 where comment_post_ID = 148;

The above is the detailed content of What is the SQL statement for modifying the ID of an article in WordPress?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn