Saturday, September 26, 2015

Remove Multisite Option from Wordpress

WordPress blog when you want to create multi language or multi site than it allow you option by some changes in coding. This functionality is useful when you want to set different post content for each website or many countries, languages then you must create multi website. Multi site also use when you want to create multi domain website.
To Enable multi site option or create a multi site in your current WordPress website than see details here.
Some times you does not need multi website option or back to same or original wordpress site from multi website than here simple and basic steps for remove multi website or network option in WordPress
  1. Open your wp-config file on WordPress root folder
  2. Find define('WP_ALLOW_MULTISITE',true); and replace to define('WP_ALLOW_MULTISITE',false);
  3. Remove below code from that file which is added during create multi site

    define( 'MULTISITE', true );
    define( 'SUBDOMAIN_INSTALL', false );
    $base = '/wordpress/';
    define( 'DOMAIN_CURRENT_SITE', 'localhost' ); //Server path
    define( 'PATH_CURRENT_SITE', '/wordpress/' ); //WordPress directory name
    define( 'SITE_ID_CURRENT_SITE', 1 );
    define( 'BLOG_ID_CURRENT_SITE', 1 );
  4. Delete current .htaccess file and recreate by default WordPress(Login to admin panel and change permalink than .htaccess auto generate if folder permission is 777)
  5. Now enter into phpMyAdmin for database access.
  6. Remove spam and deleted field from wp_users table (where 'wp_' is table prefix). Enter below sql query for that.

    ALTER TABLE `wp_users` DROP `spam`, DROP `deleted`;
  7.  Delete all tables which are related to second blog like `wp_2_commentmeta` where 2 is site id of second site which you can find in wp_site table
  8. Now delete all below tables for multi site
    • wp_blogs
    • wp_blog_versions
    • wp_registration_log
    • wp_signups
    • wp_site
    • wp_sitemeta
    For delete above tables use below sql query

    DROP TABLE `wp_blogs`, `wp_blog_versions`, `wp_registration_log`, `wp_signups`, `wp_site`, `wp_sitemeta`;
Run website and check admin panel multi site option was removed.

No comments :

Post a Comment