Updates from October, 2009

  • WordpressMU: changing domain names.

    oremj 12:12 pm on October 27, 2009 | 0 Permalink | Reply

    Unfortunately, changing domain names in WordpressMU is a manual process. It’s something I’ve come across often and have to look it up each time. Here’s what I did, so I don’t have to look it up again. Original idea from Boris Masis.

    1. Drop and run this script in the root wpmu directory:

    <?php
    define('WP_INSTALLING', true);
    require_once('wp-load.php');
    
    $old_domain = 'olddomain.com';
    $new_domain = 'newdomain.com';
    
    $query = "UPDATE wp_site SET domain = '$new_domain' where domain = '$old_domain'";
    $wpdb->query($query);
    
    $query = "UPDATE wp_blogs SET domain = REPLACE(domain, '$old_domain', '$new_domain')";
    $wpdb->query($query);
    
    $querystr ="SHOW TABLES LIKE 'wp_%_options'";
    
    $tables = $wpdb->get_results($querystr, ARRAY_N);
    
    echo count($tables);
    $query = "";
    if ($tables){
      foreach ($tables as $table){
        $query = 'UPDATE '.$table[0]." SET option_value = REPLACE(option_value,'$old_domain','$new_domain')";
        $wpdb->query($query);
      }
    }
    ?>
    

    2. Edit wp-config.php and set “DOMAIN_CURRENT_SITE” to the appropriate domain.

    That’s it, everything should work properly.

     
  • SimpleCaptcha Plugin

    oremj 3:46 pm on December 28, 2006 | 0 Permalink | Reply

    The other day spent several hours searching for a Wordpress MU(WPMU) compatible captcha plugin with no success. I didn’t care about a robust spam fighting packages with Bayesian filtering etc; all I wanted was very simple and accessible plugin. Yesterday, I came up with SimpleCaptcha. So far SimpleCaptcha seems to be working very well against spam bots.

     
c
compose new post
j
next post/next comment
k
previous post/previous comment
r
reply
e
edit
o
show/hide comments
t
go to top
esc
cancel