0

How to add post titles with new titles via sql? example post title now "beddu". i want to adding/ change "Add beddu" thank before

1

1 Answer 1

0

The first thing you want to do will be find the post you want to modify. To find the post named "beddu" which post_type is post, you can excute this query:

SELECT *
FROM wp_posts
WHERE post_type = 'post'
  AND post_title = 'beddu';

After you test and find the condition is correct. Move to update part.

UPDATE wp_posts
SET post_title = 'Add beddu'
WHERE post_type = 'post'
  AND post_title = 'beddu';

Remember to change wp_posts to your corresponding table name.

3
  • Thanks for U attention... How do I change that for all post titles. Add titles at the beginning. Because my post title name is not just "beddu" Sep 24, 2018 at 9:13
  • For all posts, you just need to remove AND post_title = 'beddu' from the SQL command
    – Tung Du
    Sep 26, 2018 at 2:56
  • Be sure to always backup your database.
    – Tung Du
    Sep 26, 2018 at 2:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.