WordPress version 3.0 or above support multi-site feature. With the help of this feature it is possible to create multi site network in woocommerce. In this article we will cover how to create multiple websites in woocommerce.
Let’s jump to the step to start.
Step 1: Install WordPress in your local web server
To install WordPress in your local server you are required the following software:
- WordPress version 5.x. You can download it from here.
- Download a local server software to create a local host. You can use XAMPP, WAMP or MAMP. Here we have used XAMPP as the local host.
- After the installation of XAMPP server successfully, go to the directory of XAMPP software. By default it will be installed in C: Drive of your computer/laptop.
- Extract the WordPress zip file that you have downloaded and paste the folder into the htdocs folder of XAMPP server.
- Now run the XAMPP Control panel. You will see a window like the following.
- Click on Start button to run the Apache and MySQL.
- Create your WordPress Database by opening a browser and type http://localhost/phpmyadmin/ in the browser URL.
- Open a new tab on your browser and type http://localhost/Wordpress .Here WordPress is the folder name that you have pasted in the htdocs folder.
- Choose the language and click on “Continue” button.
- Skip all the welcome message and click on “Let’s go!” button to start.
- Now fill up the field of User name and Password.
- Click on “Run the install”.
- Provide the “User Name”, “Password” and “Your email” in the respective field and
- Click on “Install WordPress” button.
Step 2: Add WooCommerce plugin to your WordPress
- Log in to your WordPress with valid credentials like User Name and Password that you have used in the first step.
- From vertical toolbar select “Plugins” and click on “Add New” button.
- Type WooCommerce in the search bar and click on the “Install Now” button.
- After successful installation click on the Activate button to activate the plugin.
- Now you will get WooCommerce in the plugins list.
Step 3: Enable multiple website creation in WooCommerce
- Deactivate all your active plugins before you begin with the network installation process.
- To enable the Network set up menu, Multisite should be defined first in “wp-config.php” file.
- For that purpose go to wp-config.php file in the hosted folder.
- Now and add /* Multisite */define( ‘WP_ALLOW_MULTISITE’, true ); above where it says /* That’s all, stop editing! Happy blogging. */. as like the above screenshot.
- Now refresh your browser to continue.
- Enable the Network Setup item in your Tools menu.
- Go to Tools > Network Setup.
- Check all the details and click on Install button.
- In order to enable the network, we need to follow the two steps below, but before that make sure to keep a backup of your existing wp-config.php and .htaccess files.
1. Add the specified lines to wp-config.php file (These lines must be added just after the Multisite definition as just in the previous steps)
define(‘MULTISITE’, true);
define(‘SUBDOMAIN_INSTALL’, false);
define(‘DOMAIN_CURRENT_SITE’, ‘127.0.0.1’);
define(‘PATH_CURRENT_SITE’, ‘/wordpress/’);
define(‘SITE_ID_CURRENT_SITE’, 1);
define(‘BLOG_ID_CURRENT_SITE’, 1);
2. Add the specified lines to .htaccessfile (If you do not have a .htaccess file, then you have to create it in the same directory as your wp-config.php file and if you already have a .htaccess file, replace the existing codes with these new ones)
# BEGIN WordPress
RewriteEngine On
RewriteBase /wordpress/
RewriteRule ^index\.php$ – [L]
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ – [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]
# END WordPress
- After finishing these steps, log in again with the link provided. See the attachment below.
Step 4: Create multiple websites in WooCommerce
- When you log in again “My Sites” icon will be visible on the top left corner of the page.
- Now go to My Sites >Network Admin > Dashboard >Create a New Site.
- Fill up the blank field with details and and click on “Add site”.
- Now Click on “Save Changes”.
You May also like: Optimize WooCommerce for Higher Conversion Rates