Integrating WordPress into Magento 2

Integrating WordPress into Magento 2

Adam Morgan

Magento 2 is now the most popular and possibly the best eCommerce platform currently available online. However, to help ensure that your Magento 2 store remains successful, it’s important that you are able to attract a lot of traffic and visitors.  There are a number of different ways that you can help drive traffic to your Magento store, but we can all agree that nothing works better than a blog.  WordPress is often the best platform to use when setting up your own blog.  In this article, we’ll talk you through the integration process between WordPress and Magento 2.

Installing WordPress

The first step you need to complete is installing WordPress.  To do this you will need to visit the official WordPress site and download the latest version.  From there, you can upload the zip folder to the root directory in your Magento 2 store.  Then it is just a matter of extracting the archive folder.  You will then be left with a folder conveniently labelled WordPress.  Make sure to rename this folder as wp.

You will then be able to open a new web browser and insert the URL for your Magento store.  You can add wp/ at the end.  This will open the WordPress installation screen.  It’s easy to insert the details of your database and hit the submit button.

If you get an error that says the installation is unable to write the wp-config.php file, there is an easy fix.  All you need to do is manually create a config file in your directory.  You will then be able to copy the code that appears on your screen and paste it back into a wp-config.php file. You should then be able to run the installation.

Now you should see the Welcome page.  All that’s left to do is enter your WordPress details and hit install.

Installing Magento WordPress Integration Module

To do this, you’ll need to go to the app folder.  This can be found in the root directory of your store.  You will then need to create the directories code/FishPig.

It’s easy to download the integration module, which is aptly titled FishPig.  You can then extract the archived folder.  You’ll be left with a folder that starts with Magento 2 and ends in master.  Simply rename this folder to WordPress and upload it to your Magento store.

You will then be required to run a number of commands in the root directory of your Magento 2 store.  All that’s left to do is visit the admin panel of your store and click on the WordPress option.  It’s important that you ensure this option is enables and the path is set as ‘wp’.

Configuring in WP

Login to the admin panel of your WordPress and head to General in the Settings section.  Here, you’ll be able to change the URL from ending in /wp to ending in /blog.  You can then click on save changes.  All that’s left to do is head to Appearance and then themes.  You can then activate the FishPig Theme.

Once you activate this theme, you’re done!  You can then open the frontend of your Magento 2 store by adding blog at the end of its URL and you’ll see that you have successfully integrated your blog into your store.

Already integrated your WordPress blog?  Let us know in the comments below.

Adam Morgan

Author Adam Morgan

More posts by Adam Morgan