Do you have access to MYSQL for the site? Either from the command line or something like PHPMyadmin?
If you do then your easiest solution is just to do it with a couple of sql calls, at least if all posts are going to all link to the same thing.
1. Make a copy of the wp_posts table.
create table wp_posts_backup select * from wp_posts
2. Make the changes to the wp_posts table.
update wp_posts set post_content='<a href="http://url_to_link_to_goes_here">' + trim(post_content) + '</a>'
Now all posts should be linked to whatever url you specified.
There is danger in there if you have any quotation marks(") within the post_content itself. In that case the query would have to be worked a bit to handle that.
If you want to selectively update posts, meaning when you have something in the text go to one url and when you have something else go to another url then you would use the where clause to designate what's what.
example. update anything that mentions cams.com to link to your cams.com url and anything that mentions chaturbate to link to your chaturbate url.
Cams.com update: update wp_posts set post_content='<a href="http://cams.com_url_goes_here">' + trim(post_content) + '</a>' where post_content like '%cams.com%'
Chaturbate update: update wp_posts set post_content='<a href="http://chaturbate.com_url_goes_here">' + trim(post_content) + '</a>' where post_content like '%chaturbate.com%'
You could also handle multiple conditions within one query by using a case statement:
update wp_posts set post_content='<a href="' +
case
when instr(post_content,'chaturbate.com')>0 then 'http://chaturbate.com_url_goes_here'
when instr(post_content,'cams.com')>0 then 'http://cams.com_url_goes_here'
else
'http://default_url_goes_here'
end
+ '">' + trim(post_content) + '</a>'
There are many other ways to do it but these are probably the most straight forward.
If you go back to the site and no posts show then you got something wrong in there and you need to look at the post text and debug to figure out what you need to do. If needed you drop back to the backup table.
This takes care of the posts currently on the site. It does NOT take care of future posts.
This can all be very dangerous. USE AT YOUR OWN RISK AND DON'T COME BLAMING ME IF YOU FUCK IT UP.
I also do not guarantee the syntax as I wrote it. I did it off the top of my head and I could have a quote mark or apostrophe wrong in there. I always suggest you test stuff and make sure you have it write before committing yourself. As always the information contained in this post might be worth exactly what you paid for it.
Hope that helps.
.
__________________
All cookies cleared!
|