Following a question on the WordPress-MU support forum titled How to change default posts_per_page for all blogs? here is the script I use to set different options for all existing blogs. Please note that for new blogs you should set the options in the wp-admin/upgrade-schema.php file.
Important note: this script is released with no warranty of any kind. Use it at your own risk. On the other hand, this is the script I use on my WPMU installation.
Download the update-wpmu-global-option.zip file and extract it to your root folder. Open the file for editing and in lines 2 to 5 enter the needed parameters. Just copy the values that are stored in your wp-config.php file
$db_host = ‘localhost’;
$db_user = ”;
$db_password = ”;
$db_name = ”;
In line 13 you should enter the name of the option, option_name, and the new value, option_value.
“UPDATE wp_${id}_options SET option_value = ‘5’ WHERE option_name = ‘posts_per_page'”
In the above example, and to answer the specific question in the forum, I’m setting the post_per_page option to 5.
Now all is needed is to run the script from your browser
Did you find this post interesting? Please subscribe to my feed.
Post a Comment