Skip to main content
Added other version
Source Link
tfrommen
  • 9.2k
  • 7
  • 39
  • 59

This is the SQL:

UPDATE <YOUR_PREFIX_HERE>_posts SET post_content = replace(post_content, 'www.lol.com/?http://rapidshare.com', 'http://rapidshare.com');

Either inject it directly into the database (via PHPmyAdmin and the like) or use WordPress to do so.

Here's the WordPress way:

global $wpdb;
$wpdb->query(
    $wpdb->prepare(
        "UPDATE <YOUR_PREFIX_HERE>_posts
        SET post_content = replace(post_content, %s, %s)",
        'www.lol.com/?http://rapidshare.com',
        'http://rapidshare.com'
        )
);

// EDIT
For completeness (as @birgire suggested): if you don't know the table prefix, you can let WordPress look that up:

global $wpdb;
$wpdb->query(
    $wpdb->prepare(
        "UPDATE {$wpdb->posts}
        SET post_content = replace(post_content, %s, %s)",
        'www.lol.com/?http://rapidshare.com',
        'http://rapidshare.com'
        )
);

This is the SQL:

UPDATE <YOUR_PREFIX_HERE>_posts SET post_content = replace(post_content, 'www.lol.com/?http://rapidshare.com', 'http://rapidshare.com');

Either inject it directly into the database (via PHPmyAdmin and the like) or use WordPress to do so.

Here's the WordPress way:

global $wpdb;
$wpdb->query(
    $wpdb->prepare(
        "UPDATE <YOUR_PREFIX_HERE>_posts
        SET post_content = replace(post_content, %s, %s)",
        'www.lol.com/?http://rapidshare.com',
        'http://rapidshare.com'
        )
);

This is the SQL:

UPDATE <YOUR_PREFIX_HERE>_posts SET post_content = replace(post_content, 'www.lol.com/?http://rapidshare.com', 'http://rapidshare.com');

Either inject it directly into the database (via PHPmyAdmin and the like) or use WordPress to do so.

Here's the WordPress way:

global $wpdb;
$wpdb->query(
    $wpdb->prepare(
        "UPDATE <YOUR_PREFIX_HERE>_posts
        SET post_content = replace(post_content, %s, %s)",
        'www.lol.com/?http://rapidshare.com',
        'http://rapidshare.com'
        )
);

// EDIT
For completeness (as @birgire suggested): if you don't know the table prefix, you can let WordPress look that up:

global $wpdb;
$wpdb->query(
    $wpdb->prepare(
        "UPDATE {$wpdb->posts}
        SET post_content = replace(post_content, %s, %s)",
        'www.lol.com/?http://rapidshare.com',
        'http://rapidshare.com'
        )
);
added 260 characters in body
Source Link
tfrommen
  • 9.2k
  • 7
  • 39
  • 59

This is the SQL:

UPDATE <YOUR_PREFIX_HERE>_posts SET post_content = replace(post_content, 'www.lol.com/?http://rapidshare.com', 'http://rapidshare.com');

Either inject it directly into the database (via PHPmyAdmin and the like) or use WordPress to do so.

Here's the WordPress way:

global $wpdb;
$wpdb->query(
    $wpdb->prepare(
        "UPDATE <YOUR_PREFIX_HERE>_posts
        SET post_content = replace(post_content, %s, %s)",
        'www.lol.com/?http://rapidshare.com',
        'http://rapidshare.com'
        )
);

This is the SQL:

UPDATE <YOUR_PREFIX_HERE>_posts SET post_content = replace(post_content, 'www.lol.com/?http://rapidshare.com', 'http://rapidshare.com');

Either inject it directly into the database (via PHPmyAdmin and the like) or use WordPress to do so.

This is the SQL:

UPDATE <YOUR_PREFIX_HERE>_posts SET post_content = replace(post_content, 'www.lol.com/?http://rapidshare.com', 'http://rapidshare.com');

Either inject it directly into the database (via PHPmyAdmin and the like) or use WordPress to do so.

Here's the WordPress way:

global $wpdb;
$wpdb->query(
    $wpdb->prepare(
        "UPDATE <YOUR_PREFIX_HERE>_posts
        SET post_content = replace(post_content, %s, %s)",
        'www.lol.com/?http://rapidshare.com',
        'http://rapidshare.com'
        )
);
Source Link
tfrommen
  • 9.2k
  • 7
  • 39
  • 59

This is the SQL:

UPDATE <YOUR_PREFIX_HERE>_posts SET post_content = replace(post_content, 'www.lol.com/?http://rapidshare.com', 'http://rapidshare.com');

Either inject it directly into the database (via PHPmyAdmin and the like) or use WordPress to do so.