|   |   |   | ||||
| 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 | 
|  03-21-2012, 02:15 PM | #1 | 
| Confirmed User Industry Role:  Join Date: Jul 2008 Location: In your back seat with duck tape 
					Posts: 4,568
				 | 
				
				How do this with wordpress? Mass replace post content and links
			 Hello i bought a bbw blog thats filled with pirate download links like this  http://pimpandhost.com/images/141000-original.html and text like this (links are not clickable on blog) I would like to completely delete this box on about 1200 post [downloads_box title="Big Big Babes 29"] http://depositfiles.com/files/wcqsj715h http://depositfiles.com/files/lyfqkq95c http://depositfiles.com/files/v58orlv23 or http://www.wupload.com/file/78468061...AABU.part1.rar http://www.wupload.com/file/78730349...AABU.part2.rar http://www.wupload.com/file/78771182...AABU.part3.rar [/downloads_box] The issue with search and replace plugin i see so far is i cant do this: Search for: http://pimpandhost.com/images/*any query string* and Replace with: aebn link or something. Is there a way to do this in mysql or should i just delete the 1200+ post? The blog has 3900 + post of course the latest 1200 are pirate link post but I for some reason i think this kid would have made more money with all sponsor content, but looks like when the fetishhits rss feed stopped he started pirating lol. Anyways any help with this would be appreciated thanks. 
				__________________ High Performance Vps $10 Linode Manage your Digital Ocean, Linode, or Favorite Cloud Server. Simple, fast, and secure Server Pilot | 
|   |           | 
|  03-21-2012, 02:20 PM | #2 | 
| Confirmed User Industry Role:  Join Date: Jul 2008 Location: In your back seat with duck tape 
					Posts: 4,568
				 | bumppppp 
				__________________ High Performance Vps $10 Linode Manage your Digital Ocean, Linode, or Favorite Cloud Server. Simple, fast, and secure Server Pilot | 
|   |           | 
|  03-21-2012, 02:30 PM | #3 | 
| Confirmed User Industry Role:  Join Date: Jan 2005 
					Posts: 1,041
				 | just search and replace the domain names in mysql and then send to your own domain that just refreshes all the 404's etc to your own landing page or to aebn if they catch your refreshes. 
				__________________ Pr0phet | 
|   |           | 
|  03-21-2012, 06:05 PM | #4 | 
| Confirmed User Industry Role:  Join Date: Jul 2008 Location: In your back seat with duck tape 
					Posts: 4,568
				 | ok got the first part come again? 
				__________________ High Performance Vps $10 Linode Manage your Digital Ocean, Linode, or Favorite Cloud Server. Simple, fast, and secure Server Pilot | 
|   |           | 
|  03-21-2012, 06:39 PM | #5 | 
| So Fucking Banned Industry Role:  Join Date: Jan 2011 
					Posts: 770
				 | |
|   |           | 
|  03-21-2012, 07:48 PM | #6 | 
| Confirmed User Industry Role:  Join Date: Jul 2008 Location: In your back seat with duck tape 
					Posts: 4,568
				 | fuck it ill just delete this shit 
				__________________ High Performance Vps $10 Linode Manage your Digital Ocean, Linode, or Favorite Cloud Server. Simple, fast, and secure Server Pilot | 
|   |           | 
|  03-21-2012, 11:16 PM | #7 | 
| She is ugly, bad luck. Industry Role:  Join Date: Jan 2010 
					Posts: 13,177
				 | 404 page with PHP redirect either to your home page or sponsor - it will collect everyone that goes to one of the replaced links as they don't exist as a file on your domain. 
				__________________ ↑ see post ↑ 13101 | 
|   |           | 
|  03-22-2012, 06:59 AM | #8 | 
| Too lazy to set a custom title Industry Role:  Join Date: Aug 2002 
					Posts: 55,372
				 | do search and replace regex, and get the regex for the download box part, if thats the only thing you are removing. 
				__________________ Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.  WP Stuff | 
|   |           | 
|  03-22-2012, 07:29 AM | #9 | 
| Too lazy to set a custom title Industry Role:  Join Date: Aug 2002 
					Posts: 55,372
				 | regex could be something like Code: $html = '[downloads_box title="big boobs"]http://www.domain.com/files/files.avi.html[/downloads_box]'; $regex = '/\[(\[?)(downloads_box)\b([^\]\/]*(?:\/(?!\])[^\]\/]*)*?)(?:(\/)\]|\](?:([^\[]*+(?:\[(?!\/\2\])[^\[]*+)*+)\[\/\2\])?)(\]?)/s'; $new = preg_replace($regex,' replacement',$html); echo $html . 'will be replaced with' . $new; 
				__________________ Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.  WP Stuff | 
|   |           | 
|  03-22-2012, 08:51 AM | #10 | 
| Beer Money Baron Industry Role:  Join Date: Jan 2001 Location: brujah / gmail 
					Posts: 22,157
				 | It looks like a shortcode plugin or function "downloads_box", could you just deactivate/delete the plugin?  Then add this to your functions.php file somewhere to empty the info. Code: function my_downloads_box( $atts, $content = null ) {
 return '';
}
add_shortcode( 'downloads_box', 'my_downloads_box' );
				__________________ 
 | 
|   |           | 
|  03-22-2012, 09:54 AM | #11 | |
| Too lazy to set a custom title Industry Role:  Join Date: Aug 2002 
					Posts: 55,372
				 | Quote: 
 
				__________________ Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.  WP Stuff | |
|   |           | 
|  03-23-2012, 11:39 PM | #12 | 
| Confirmed User Industry Role:  Join Date: Jul 2008 Location: In your back seat with duck tape 
					Posts: 4,568
				 | you guys are past awesomeness   
				__________________ High Performance Vps $10 Linode Manage your Digital Ocean, Linode, or Favorite Cloud Server. Simple, fast, and secure Server Pilot | 
|   |           | 
|  03-25-2012, 02:24 PM | #13 | 
| Too lazy to set a custom title Industry Role:  Join Date: Aug 2002 
					Posts: 55,372
				 | if you want to remove it completely from the db, here is the code i use/used Code: 
function remove_shortcode_from_db($shortcode = 'button') {
    global $wpdb;
    $posts = $wpdb->get_results("SELECT ID,post_title,post_content FROM $wpdb->posts");
    $regex = '/\[(\[?)('.$shortcode.')\b([^\]\/]*(?:\/(?!\])[^\]\/]*)*?)(?:(\/)\]|\](?:([^\[]*+(?:\[(?!\/\2\])[^\[]*+)*+)\[\/\2\])?)(\]?)/s';
    foreach($posts as $post) {
        $final = preg_replace($regex,'',$post->post_content);
        $change = $wpdb->update( $wpdb->posts, array('post_content' => $final), array('ID' => $post->ID));
    }
}Code: remove_shortcode_from_db('downloads_box');
				__________________ Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.  WP Stuff | 
|   |           | 
|  03-25-2012, 02:34 PM | #14 | |
| So fuckin' bored Industry Role:  Join Date: Jun 2003 
					Posts: 32,386
				 | Quote: 
 Code: $post->post_content = str_replace('word1', 'word2', $post->post_content);
$post->post_excerpt = str_replace('word1', 'word2', $post->post_excerpt);Code: $post->post_title = str_replace('bad_word', '', $post->post_title);
				__________________ Obey the Cowgod | |
|   |           | 
|  03-25-2012, 04:26 PM | #15 | |
| Too lazy to set a custom title Industry Role:  Join Date: Aug 2002 
					Posts: 55,372
				 | Quote: 
 
				__________________ Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.  WP Stuff | |
|   |           | 
|  03-27-2012, 02:41 PM | #16 | |
| Confirmed User Industry Role:  Join Date: Jul 2008 Location: In your back seat with duck tape 
					Posts: 4,568
				 | Quote: 
  
				__________________ High Performance Vps $10 Linode Manage your Digital Ocean, Linode, or Favorite Cloud Server. Simple, fast, and secure Server Pilot | |
|   |           | 
|  03-27-2012, 02:45 PM | #17 | 
| SZNY Industry Role:  Join Date: May 2004 Location: Sexy Republic 
					Posts: 2,800
				 | Here some queries that can be useful UPDATE wp_options SET option_value = replace(option_value, 'http://www.old-domain.com', 'http://www.new-domain.com') WHERE option_name = 'home' OR option_name = 'siteurl'; After that you will need to fix URLs of the WordPress posts and pages, which translated from post slug, and stored in database wp_posts table as guid field. The URL values in this field are stored as absolute URLs instead of relative URLs, so it needs to be changed with the following SQL query: UPDATE wp_posts SET guid = replace(guid, 'http://www.old-domain.com','http://www.new-domain.com'); If you have linked internally within blog posts or pages with absolute URLs, these links will point to wrong locations after you move the blog location. Use the following SQL commands to fix all internal links to own blog in all WordPress posts and pages: UPDATE wp_posts SET post_content = replace(post_content, 'http://www.old-domain.com', 'http://www.new-domain.com'); UPDATE `wp_postmeta` SET `meta_value` = replace(meta_value, '212-555-1212', '212-444-1212') WHERE `meta_key` LIKE 'DeptPhone' 
				__________________ Telegram: sandroanthonio | 
|   |           |