![]() |
search and replace part of url in wordpress posts??
hi
just a quick question. i need to modify part of a url in lots of posts in some wordpress blogs. the table and field is wp_posts post_content so if some of these posts contain the url http://www.somesite.com/folder and i want to change it to http://www.anothersite.com/folder does anyone know what sql i should use in phpmyadmin to make this change on all the posts? there's obviously other text in the posts to be changed that i want left alone its just a particular url i want to change. any help appreciated, thanks in advance |
it's ok got it now:
UPDATE tablename SET tablefield = replace(tablefield,"findstring","replacestring"); |
nxt time try search and replace.
or for critical tasks, try regex replace |
u can also write a wp plugin to do this really easily
something like this (untested) add_filter('the_content','myreplacer'); function myreplacer($s) { return str_replace('from','to',$s); } will want to add the_extract possibly too to add_filter. |
Quote:
|
Quote:
|
All times are GMT -7. The time now is 06:51 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123