Skip to content
Podcast header in green
Ecommerce

Magento/WordPress Integration: A Tutorial

(Author's Note: Be sure to test any integration efforts on a staging or test environment before moving them to a live production site.)

Anyone who has worked with Magento knows that its blog capabilities are rather limited. Thankfully, however, the Magento community (the community of Magento developers — not the Community Version of the Magento Platform) have developed incredibly robust platform functionality enhancements, which you can access via the extensions in Magento Connect.

One such extension, created by FishPig, is the (ever so cleverly named) Magento WordPress Integration extension. This extension offers you very limited functionality for WordPress, along with the ability to automatically skin your WordPress theme to look just like your Magento theme. The one major drawback is that it's quite challenging to add and use WordPress plugins.

So what do you do if you want to access the plugins you’ve used in the past on WordPress?

Enter the MWI plugin. With it, you can use all of the WordPress plugins AND keep Magento and WordPress separate, but also have them work side by side. Unlike with FishPig's Magento WordPress Integration, however, you will have to do some style work to make your WordPress theme match your Magento theme. It's easy to do, with minimal work if you follow these steps:

(Note: these instructions were written for Magento Community Version 1.9.1.0. If you are using an older version of Community, you may not be as successful with your integration. If you DO run into issues, please feel free to contact us.)

Step 1

Download the latest version of WordPress (at the time of this writing, that was 4.2.1). While it's downloading, think through the exact path that you want for your WordPress install. The default when unzipping the file is "WordPress". However, many people opt to name the folder "blog" instead. Decide what you want and stick to it, otherwise you'll have some headaches later on.

If you use choose to name the file something other than "blog", replace "blog" with your name for the file moving forward through the instructions.

Step 2

Rename your new WordPress folder to "blog" (or whatever you're calling it) and place it in the root of your Magento instance.

Some people prefer to have Magento inside of the WordPress folder and reference all Magento pages with /shop. It's an easy thing to change, however, this tutorial was designed to have the WordPress folder inside your Magento instance. If you are placing Magento inside of WordPress, this setup may not work correctly.

Step 3

Finish the WordPress install by going to siteurl/blog/wp-admin. On this page, you will be asked for the database information that WordPress needs to create the necessary tables. Once created, set up an admin user (along with a few other things, which WordPress should prompt you through). Upon completion, log in to the WordPress admin.

Step 4

Install the MWI plugin, which you will find here and upload it through FTP or the WordPress admin.

Step 5

Once the plugin is installed, follow these instructions. If you don't follow these instructions, you will run into issues.

Once the plugin is installed, you will see a new option under Settings on the left-hand side called “Mage/Wp”. In this area, update all of the fields. The mage path is the most important. The nice thing about this plugin is that it gives you your Magento root path right away. So, all you should have to do is add “app/Mage.php”.

When you save, you will know immediately if you followed the instructions correctly. If not, the plugin will give you the exact steps needed to make it work.

Once your Mage path is correct, you can specify the theme and package you are using in Magento.

Congratulations!

Magento and WordPress are now working side by side.

Upon completion, there are a few additional things that you may be interested in doing.

1.) To Access WordPress function inside of Magento

$admin = "admin";

$uri = $_SERVER['REQUEST_URI'];

$adminCheck = strpos($uri, $admin);

$wpload = "blog/wp-load.php";

if ($adminCheck) { // You may need to load this on certain admin pages like the customer one if you are trying to sync users

} else {

require_once($wpload);

}

2.) Bring Magento blocks over to WordPress.

It's easy to move your styling and js over to WordPress by using the get_block function provided to you by the MWI Plugin. Simply call in your theme header file, and you will get access to your Magento stylesheets.

Additionally, once you have implemented this plugin, you will be able to bring WordPress's menus to Magento and show products in WordPress.

But that's a topic for another day.

More reads

Ecommerce
BFCM Preview 2
Maximizing Your BFCM Success: Strategic Prep for Lasting Customer Loyalty and Strong Post-Holiday Results
Musings
Heatmaps PNG
Turn Clicks into Cash: How Heat Maps Can Drive Website Revenue
Press Release
rince na chroi hero
Rince na Chroi selects Irish Titan as their Digital Dance Partner
Musings
Elissa Email Marketing Article
If You Don't Have These Automated Emails Set, You're Leaving Money on the Table
Press Release
ecomm forum 10th annual
Ecomm Forum Celebrates 10 Years Around the Sun
Go forth and read

More from Ecommerce...

BFCM Preview 2
Ecommerce
Maximizing Your BFCM Success: Strategic Prep for Lasting Customer Loyalty and Strong Post-Holiday Results

Setting yourself up for success pre-BFCM can lead to strong long term results

Podcast header in green
Ecommerce
Guest Post: ShipEngine - Beyond Free Shipping: The Growing Demand for Premium Delivery Experiences

Learn how going beyond free shipping by offering premium delivery options can help you win big this holiday season. In an age where free shipping is often expected, learn how to set your business apart with premium delivery experiences...

Omnichannel Shipping Preview updated size
Ecommerce
Omnichannel + Shipping

Due to the rise in omnichannel, having a shipping platform is especially important now. When you have multiple channels, you are selling on, you must be flexible in all the ways and places you might ship to and who you are working with...