wordpress - MYSQL remove word from a column in a table -


i'm using wordpress , want go through entire wp_posts database using mysql remove word "on" slugs.

i've tried these 2 lines;

update wp_posts set post_name = replace(post_name, '%on-%', '') post_type = "post";  select *, replace(post_name, '%on-%', '') wp_posts post_type = "post"; 

they dont remove word 'on' things such "12th-annual-helmets-on-kids-campaign"

thanks guys

try

update wp_posts set post_content = replace(post_name, 'on-', '') post_type = "post"; 

and omit %.


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -