Magento WordPress Root InstallationRoot

« Back to Magento WordPress Root

Before installing the Root add-on module, ensure that you have the latest version of Magento WordPress Integration and all other FishPig add-on modules.

Install the Extension

You can install the module using Composer or you can manually install it using FTP.

  • Run the following commands in your Magento root directory to install the module using Composer.

    # Add the FishPig Composer repo
    composer config repositories.fishpig composer https://repo.fishpig.co.uk/
        
    # Install the module using Composer
    composer require fishpig/magento2-wordpress-integration-root
    
    # Enable the module in Magento 2
    php bin/magento module:enable FishPig_WordPress_Root
    
    # Run the Magento upgrade system
    php bin/magento setup:upgrade
  • You can download the latest version of the module from the Downloads page.

    Extract the ZIP file and upload the files to your Magento site at the directory below:

    app/code/FishPig/WordPress_Root

    When creating the folders, ensure you use the correct capitalisation.

    To complete the installation, run the following commands in a terminal.

    # Enable the module in Magento 2
    php bin/magento module:enable FishPig_WordPress_Root
    
    # Run the Magento upgrade system
    php bin/magento setup:upgrade

Configuration

Once the module is installed, you need to make some small WordPress configuration changes.

WordPress URLs

Next you need to change the WordPress home URL to be the base URL of your Magento store. To do this, login to the WordPress Admin and select Settings > General. You should see 2 URL fields. Change the second field to your Magento store's base URL.

wp-config.php

To finish the configuration, open your wp-config.php file and find the WP_DEBUG line and add the following below it:

define('COOKIEPATH', '/'); // Add this below the WP_DEBUG line

While it's useful to remove /blog/ (or whatever your blog URL is) from some URLs, it's useful to keep it for your default posts. To do this, select Settings > Permalinks in the WordPress Admin and add /blog/ to the permalink structure (eg. /blog/%postname%/).

Create a Default Post List Page (blog/)

If you add /blog/ back in to your default blog posts, you will want to create a /blog/ page to list all of your blog posts. This is the page that is the standard WordPress homepage and probably was your blog homepage before installing Root. To do this, first create a WordPress page and then select this page from the drop down at Settings > Reading > Your homepage displays > A static page > Posts Page.

Replace the Magento Homepage

To replace the Magento homepage with a page created in WordPress, create a new page in WordPress, publish it and then select it from the dropdown at Settings > Reading > Your homepage displays > A Static page > Homepage.

Documentation