|
|
|
||||
|
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() |
|
|||||||
| Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
|
Thread Tools |
|
|
#1 |
|
Confirmed User
Join Date: Jun 2003
Location: Portugal
Posts: 491
|
wordpress help
anyone know's how to find url string on all posts like out.php and replace it by exit.php for example without beeing done one by one
thanks |
|
|
|
|
|
#2 |
|
Confirmed User
Industry Role:
Join Date: Mar 2007
Posts: 7,771
|
I don't use wordpress but this may help.
#!/usr/bin/perl print "content-type: text/html\n\n"; $filname = "some/file/on/server/path.ext"; open(DD, "$filename"); @dd = <DD>; close(DD); $newdd = join("", @dd); $newdd =~ s/out.php/exit.php/ig; open(DD, ">$filename"); print DD $newdd; close(DD); print "completed"; exit; Change the yellow stuff to the actual file.
__________________
![]() ![]()
|
|
|
|
|
|
#3 |
|
Confirmed User
Industry Role:
Join Date: Nov 2003
Location: Olongapo City, Philippines
Posts: 4,618
|
THIS IS DANGEROUS CODE - run it at your own risk. Test it on a test install of word press first to be sure it's right. I have not tested this!
This should do it. If there are any other uses of out.php it will replace them as well, so if you can, add more identifying info, like your domain name, etc - as much as you can add into the replacement strings the better. It has to exactly match what it will find in the posts, of course. In this code, the first string 'out.php' will get replaced with 'exit.php' in all posts. Do I need to remind you to back up your database first? If you don't know how to run SQL commands or you don't have access to the database, look for a wordpress plugin that will do search and replace. Code:
UPDATE wp_posts SET post_content=( REPLACE (post_content, 'out.php', 'exit.php')); |
|
|
|