To get started, figure out whether your Magento installation uses the root or pub directory and then install WordPress there in a directory named wp. You can do this manually via FTP or by running the following command in the Magento root or pub directory.
curl -sS https://wordpress.org/latest.tar.gz | tar xzf - && mv -f wordpress wp
Next go to your Magento URL + /wp (eg. https://www.example.com/wp) and follow the steps to install WordPress. You can use a separate database for WordPress or the Magento database, however it is recommended that you install WordPress in it's own database.
WordPress URLs
WordPress Admin > Settings > General:
The WordPress Address field should be the WordPress installation URL and the Site Address URL should be the integrated URL. If you want your blog to be available from /blog then enter your Magento store URL + /blog
Install the Extension
You can install the module for Magento 2 using Composer or you can manually install it using FTP.
Run the following commands in your Magento 2 root directory to install the module using Composer.
# Install the module using Composer composer require fishpig/magento2-wordpress-integration:* # Enable the module in Magento 2 php bin/magento module:enable FishPig_WordPress # Run the Magento upgrade system php bin/magento setup:upgrade
You can download the latest version of the module from here.
Extract the ZIP file and upload the files to your Magento site at the directory below:
app/code/FishPig/WordPress
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 # Run the Magento upgrade system php bin/magento setup:upgrade
To complete the installation, login to the Magento Admin and select WordPress from the Admin navigation menu. If any errors have occured, they will be displayed at the top of the page.