• Dear All,

    Would like to have your guidance on the below issue:

    Using PHP MyAdmin.. What sql query would I run if I wanted to insert a string of text in the beginning of every post on my blog?

    Thanks in advance.

Viewing 2 replies - 1 through 2 (of 2 total)
  • THIS IS DANGEROUS! BACK UP THE DATABASE FIRST!

    Use this form while testing. Replace the 27 with the ID of a test post.

    UPDATE wp_posts
    SET post_content = CONCAT('some test text to insert ' , post_content)
    WHERE post_type = 'post'
       AND post_status = 'publish'
    and ID = 27

    Once you are satisfied that it will work, remove the line ‘and ID = 27’.

    Thread Starter deepak1621

    (@deepak1621)

    Hi Thanks for your reply..I also did something on the same lines..
    I added another field to the wp_posts table.

    demo_content= CONCAT('text', post_content)

    Once I was satisfied with the result, I renamed demo_content to post_content(and original post_content to something else).

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘phpMyAdmin SQL Insert’ is closed to new replies.