Redirect Main Site to Subsite in Multisite WordPress

You can use the parse_request action to accomplish this. Simply enable this plugin on your primary blog. Place the following code in a .php file and upload it to your plugins directory. /* Plugin Name: Redirect Main Site To Sub-Site Description: Redirect ‘main-site’ to ‘main-site/sub-site/’ Version: 0.1 Author: WPSE Author URI: http://wordpress.stackexchange.com License: GPL2 */ … Read more

DB connection error after copying a WordPress Multisite instance to a second location

One thought – when I go to www.example.com/staging/wp-admin it automatically redirects me to www.example.com/wp-admin Could the redirect from staging.example.com to example.com/staging be conflicting with the existing install? UPDATE: looks like it could be related to .htaccess issues and complicated domain references in the database From the WP Codex: Moving WordPress Multisite Multisite is far more … Read more

How can I un-reserve a pending username registration?

DB Access layer & deleting rows WordPress uses the wpdb class to manage access to the database layer using the global $wpdb. The class provides a method named delete() to delete rows from tables: $wpdb->delete( $table, $where, $where_format = null ); Multisite tables & activation keys WordPress has some MU specific tables, where one is … Read more

How to migrate subsite from dev multisite to production multisite

This can be somewhat tedious, but hopefully this helps. The less that changes from one environment to the next, the less painful this process will be. Particularly, if the domain, site id, file paths remain the same, the less painful this process will be. This post assumes some knowledge of database management. It is not … Read more

Where can I find documentation on what characters are allowed in user names and why?

You can use spaces in usernames, no problem. Several users on wordpress.org have spaces in their usernames. Strict mode only allows these characters: a-z0-9<space>_.\-@ However WP doesn’t default to strict mode. Now, multisite has different restrictions, and it may strip spaces there. This is because usernames are used to create independent blogs and such on … Read more

What is the correct way to map multiple domains in a WordPress 4.1 multisite install?

WordPress Multisite can handle different domains by default – but NOT with alias domains. The settings of each site store the domain. On a default install there is a subdomain or folder-structure. But you can add a single domain. Screenshots For example, the first two sites are with the same domain (default from install) and … Read more

Specific upload folder for PDFs in custom Post type in WP multisite

you might consider using if(get_post_mime_type($id) == ‘application/pdf’){ … } to check for pdf files. http://codex.wordpress.org/Function_Reference/get_post_mime_type You might also take a look at the code behind the wp_delete_attachment() function and you can hook into it with the delete attachment action. To remove the files you can use unlink() http://php.net/manual/en/function.unlink.php