1

Pretty much self explanatory. I have a development server running the latest WP, and I imported a bunch of posts from a blogger account. After the import, every post was titled as such: >Example Title . What i want to do is a run a sql query to delete all the ">" characters in the post titles. I've checked other tutorials already, but still do not understand the complete syntax of the query. Any help is appreciated.

okay this is the query i 'want' to run. update TABLE_NAME set FIELD_NAME = replace(FIELD_NAME, ‘find this string’, ‘replace found string with this string’); but what I don't understand is that, I'm trying to update my table name (which is by default wp_, right?), and I'm guessing the next step is updating the field name (which is by default wp_posts, right?), and I want to update ALL the Post Titles to remove a character that shows up in front of all of them. Example: >This Is A Post Title . I want to remove the ">" character. But what I'm lost on is if I'm doing it wrong by naming "wp_" for "TABLE_NAME", and "wp_posts" as the "FIELD_NAME". Or am I missing something in that query just all together? Hope I'm making it clear and not too confusing.

5
  • 2
    Do you have issue with doing this in WordPress or you want to just run query in MySQL (without WP involved)? I am on the fence if this is on topic for us.
    – Rarst
    Jan 4, 2012 at 9:54
  • I agree with @Rarst. Maybe if you included the query you're using, or reference what WP functions (if any) you're trying to use it would help. But as-is, this reads like a straight MySQL question not a WordPress question.
    – EAMann
    Jan 4, 2012 at 18:43
  • wp_posts is the table, as long as you didn't change the table prefix in wp-config.php to something other than wp_. post_title is the field that contains the title.
    – Milo
    Jan 4, 2012 at 22:05
  • @Milo thank you much. but this is what I got
    – Cardin
    Jan 4, 2012 at 23:38
  • #1054 - Unknown column '‘' in 'field list' UPDATE xxx_posts SET post_title = replace( post_title, ‘ > ’, ‘’ )
    – Cardin
    Jan 4, 2012 at 23:43

1 Answer 1

1

Here is the SQL Query with everything set. This does assume you have the standard wordpress table prefix in your config.

update wp_posts set post_title = replace(post_title,">","")

Your Answer

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

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