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
Planning Part 5: Preview
Planning for the New Year Part 5: Monitor & Adjust
Ecommerce
Planning Part 4: Preview
Planning for the New Year Part 4: Focus & Expand
Ecommerce
Planning Part 3: Preview
Planning for the New Year Part 3: Streamlining & Updating
Ecommerce
Planning Part 2: Preview
Planning for the New Year Part 2: Optimization & Strategic Planning
Ecommerce
Post BFCM Preview
Turning BFCM Shoppers into Loyal Customers
Go forth and read

More from Ecommerce...

Planning Part 5: Preview
Ecommerce
Planning for the New Year Part 5: Monitor & Adjust

In the final part of our 2025 planning guide, we’re diving into a crucial practice for any successful ecommerce business: staying dynamic in an ever-changing market.

Planning Part 4: Preview
Ecommerce
Planning for the New Year Part 4: Focus & Expand

In Part 4 of our 5part series, we’re diving into a key dual goal for ecommerce businesses: growing your customer base while strengthening relationships with your current audience.

Planning Part 3: Preview
Ecommerce
Planning for the New Year Part 3: Streamlining & Updating

In today’s fast-paced ecommerce world, your website is the beating heart of your business. It’s not just where transactions happen; it’s the first place customers form an impression, where loyalty begins, and where the potential for growth lies.