PHPackages                             agilo/medusawp - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. agilo/medusawp

ActiveWordpress-plugin

agilo/medusawp
==============

MedusaWP is a WordPress plugin that enables you to use WordPress as a headless CMS or as a storefront for your Medusa shop.

v0.6.0(2y ago)371MITPHPPHP ^7.4 || ^8.0

Since Nov 28Pushed 2y ago3 watchersCompare

[ Source](https://github.com/Agilo/medusa-wp-wordpress-plugin)[ Packagist](https://packagist.org/packages/agilo/medusawp)[ RSS](/packages/agilo-medusawp/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (13)Versions (7)Used By (0)

[![MedusaWP](https://raw.githubusercontent.com/Agilo/medusawp/master/.github/banner.png "MedusaWP")](https://github.com/Agilo/medusawp)

 MedusaWP
==========

[](#--medusawp)

####  MedusaWP enables you to use [WordPress](https://wordpress.org/) as a headless CMS or as a storefront for your [Medusa](https://medusajs.com/) shop.

[](#--medusawp-enables-you-to-use-wordpress-as-a-headless-cms-or-as-a-storefront-for-your-medusa-shop)

 [ ![MedusaWP is released under the MIT license.](https://camo.githubusercontent.com/b8cadaa967891081f8f165695470689986c028821dd8a040132f6e661795dc0d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c7565) ](./LICENSE) [ ![PRs welcome!](https://camo.githubusercontent.com/7d9ed3c8f22eceb1711573169b1390cc0b1194467340dc815205060c162b5309/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5052732d77656c636f6d652d627269676874677265656e2e7376673f7374796c653d666c6174) ](https://github.com/Agilo/medusawp?tab=readme-ov-file#contributing) [ ![X (formerly Twitter) Follow](https://camo.githubusercontent.com/a3074e68d691cfe961ec54790364dda406b29ef276aa677d27b94bba7be27acf/68747470733a2f2f696d672e736869656c64732e696f2f747769747465722f666f6c6c6f772f4167696c6f) ](https://twitter.com/intent/follow?screen_name=Agilo)

 [ ![Node.js ^20](https://camo.githubusercontent.com/9bbc1ef47a9b468e38f9394353be6ae4fd9cce4391a488869ee6e48bed86f8cb/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4e6f64652e6a732d25354532302d627269676874677265656e) ](https://nodejs.org/) [ ![WordPress ^5.6](https://camo.githubusercontent.com/bc3ef0d8fa3c749192d8b1b5e5b25d635c388cc50c386b29d4838cc419b8c4ad/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f576f726450726573732d253545352e362d626c75653f6c6f676f3d776f72647072657373266c6f676f436f6c6f723d7768697465) ](https://codex.wordpress.org/WordPress_Versions) [ ![PHP Version ^7.4](https://camo.githubusercontent.com/9258dbc25385c49ec862658a11a34f3e03090831bd869b1fb3fb1607ea375d3c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d253545372e342d3737374242343f6c6f676f3d706870266c6f676f436f6c6f723d7768697465) ](https://www.php.net/) [ ![Composer ^1](https://camo.githubusercontent.com/e4e57fabd90d3dc9fea5df0cc98cee791252dbea90deafa75fc6680b9ccdd462/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f436f6d706f7365722d253545312d6f72616e6765) ](https://getcomposer.org/doc/01-basic-usage.md)

MedusaWP is a powerful tool that seamlessly integrates your Medusa e-commerce store with WordPress, offering a range of features to simplify your e-commerce management. We also provide a rich set of Medusa-oriented functions for you to utilize within your WordPress theme.

You can connect to your existing Medusa store and effortlessly import its data into WordPress. You have full visibility into the sync progress and can easily troubleshoot any issues that may arise during the synchronization process. Data health checks ensure that your synced items are error-free and successfully imported into WordPress. Managing media assets is a breeze with the ability to import Medusa thumbnails directly into the WordPress Media Library. You can also manage and display Medusa data as custom post types within your WordPress site.

For a seamless shopping experience, the plugin automatically creates a cart for customers who land on your site. A country switcher functionality is also included, allowing cart region updates based on the selected country code.

When needed, you can remove all synced data and disconnect from Medusa effortlessly.

Unlock the full potential of your Medusa store with the MedusaWP plugin and streamline your e-commerce operations.

Features
--------

[](#features)

- Use WordPress as a headless CMS or as a storefront for the Medusa shop.
- Connect to an existing Medusa store from WordPress and import its data into WordPress.
- Synchronize your Medusa e-commerce data with WordPress.
- Import Medusa thumbnails into the WordPress Media Library (either directly when syncing Medusa data or separately).
- Provide an overview and troubleshooting for the sync progress.
- Check the data health, including identifying any sync errors, partially synced items, or successfully synced data.
- Manage and display Medusa data (products, product collections...) in WordPress as custom post types (CPT).
- Automatically create a cart when the customer lands on the site for the first time (default country/region settings can be configured within the WordPress plugin settings).
- Implement a country switcher that updates the cart region based on the given country code.
- Remove all synced data.
- Disconnect from Medusa.
- Expose a rich set of functions available for you to use within your WordPress theme, including [`medusa-react` utility functions](https://docs.medusajs.com/medusa-react/overview#utilities) for computing and formatting prices and amounts.

Prerequisites
-------------

[](#prerequisites)

- [Medusa Backend](https://docs.medusajs.com/development/backend/install)
- [Redis](https://docs.medusajs.com/development/backend/prepare-environment#redis)
- [WordPress Installation](https://developer.wordpress.org/advanced-administration/before-install/howto-install/)
    - WordPress website up and running
    - Administrator access to your WordPress website
- [PHP Composer](https://getcomposer.org/download/) latest version 1.x

How To Install
--------------

[](#how-to-install)

### Medusa Plugin

[](#medusa-plugin)

1. In the root of your Medusa backend, run the following command to install the `medusa-plugin-wordpress` plugin:

```
npm i medusa-plugin-wordpress
```

2. Add the plugin to your `medusa-config.js` file at the end of the `plugins` array:

```
module.exports = {
  // ...
  plugins: [
    // ...
    {
      resolve: "medusa-plugin-wordpress",
      options: {
        // ...
      },
    },
  ],
  // ...
}
```

3. Next, configure the `medusa-plugin-wordpress` plugin that you added in the previous step. For example:

```
const plugins = [
  // ...
  {
    resolve: `medusa-plugin-wordpress`,
    options: {
      sync_options: {
        attempts: 5,
        backoff: {
          type: 'exponential',
          delay: 2000
        }
      }
    },
  },
]
```

#### Configuration Options

[](#configuration-options)

The plugin can be configured with the following options:

```
(property) sync_options: {
    delay?: number | undefined;
    attempts: number;
    backoff?: {
        type: "fixed" | "exponential";
        delay: number;
    } | undefined;
}
```

- `sync_options` - Sync options object.
    - `delay` - Delay time in milliseconds, default `undefined`.
    - `attempts` - Number of attempts, default `3`.
    - `backoff` - Backoff options object.
        - `type` - Backoff type, either `"fixed"` or `"exponential"`, default `"exponential"`.
        - `delay` - Backoff delay time in milliseconds, default `2000`.

### WordPress Plugin

[](#wordpress-plugin)

1. In the root directory of your WordPress installation, run the following command to install the plugin using Composer:

```
composer require agilo/medusawp
```

2. Log in to your WordPress admin dashboard using your administrator credentials.
3. After successful installation, click the "Activate" button to activate the plugin.
4. To finish the plugin setup, proceed to the [How To Use](#how-to-use) steps.

How To Use
----------

[](#how-to-use)

1. Run the following command in the directory of the Medusa backend to run the backend:

```
npm run start
```

2. After you have logged into your WordPress site, navigate to the MedusaWP plugin settings page, which can be found in the WordPress admin menu.
3. Connect your Medusa e-commerce store and your WordPress instance. On the default MedusaWP plugin screen enter your Medusa shop URL and credentials - email and password and press "Connect" button.

Note

If necessary, you can always disconnect from your Medusa shop by opening a dropdown in the upper-right corner, pressing the "Disconnect" button, and confirming your decision.

4. When the connection with Medusa is established, sync your Medusa e-commerce data with WordPress by clicking the "Sync" button. You can also choose to import Medusa thumbnails into the WordPress Media Library directly with the data sync (this may slightly slow down your data sync process), or you can import thumbnails separately later using the "Import" button.

Note

It is possible to remove all your synced Medusa data from your WordPress site at any time using the "Remove" button. We recommend that you backup your data before proceeding with this action.

5. Once the data synchronization is complete, configure the default settings of the MedusaWP plugin to suit your needs. In the dropdown, you can select the default country, which will be used to automatically create a cart in the corresponding region when a customer lands on the site.
6. Verify that the plugin is working as expected by visiting your website and using its features.

That's it! You have successfully installed and set up the MedusaWP plugin. Enjoy using it in your projects and on your WordPress website.

Contributing
------------

[](#contributing)

We welcome contributions from the community to help make this project even better. Please feel free to open pull requests or issues. Thank you for considering contributing, and we look forward to collaborating with you!

Below you can find the [plugin development guide](#plugin-development) that will help you get started with running MedusaWP in your local environment.

### Plugin Development

[](#plugin-development)

#### Prerequisites

[](#prerequisites-1)

- [Docker](https://docs.docker.com/get-docker/) and [Docker Compose](https://docs.docker.com/compose/install/)
    - We suggest using [OrbStack](https://orbstack.dev/download) on Mac.
- [Node.js v20](https://nodejs.org/en/download/)
    - We suggest using [nvm](https://github.com/nvm-sh/nvm) or [fnm](https://github.com/Schniz/fnm) to manage your Node.js versions.
- [PHP Composer](https://getcomposer.org/download/) latest version 1.x | 2.x

After you have installed the requirements, you will need to add a host entry for the project by appending the following line to your `/etc/hosts` file:

```
127.0.0.1    medusawp.test

```

#### Running Locally

[](#running-locally)

Follow these step-by-step instructions to run the project locally:

1. Fulfill everything mentioned in the prerequisites above
2. `git clone https://github.com/Agilo/medusawp.git` - clone the repo
3. `cd medusawp` - position into the project directory
4. `cp .env.example .env` - set up docker-compose environment variables
5. `cp ./dev/medusa/.env.example ./dev/medusa/.env` - set up Medusa environment variables
6. `npm i` - install all dependencies
7. `npm run addcert -w wordpress` - add a self-signed certificate for `medusawp.test`
8. `npm run build -w wordpress` - build WordPress
9. `composer install -d ./wordpress-plugin` - install Composer dependencies for the WordPress plugin
10. `docker-compose --profile wp --profile medusa up` - start WordPress and Medusa Docker containers
11. Open a new terminal tab
12. `npm run seed -w medusa` - seed Medusa DB
13. `npm run migrate -w medusa` - run Medusa migrations
14. `npm start` - build the Medusa plugin and start the Medusa dev server and Medusa plugin watcher

WordPress is now available at  and Medusa Admin dashboard at .

Default credentials for Medusa Admin are:

```
admin@medusa-test.com
supersecret

```

Default credentials for WordPress are:

```
admin
admin

```

#### Available Commands

[](#available-commands)

- `npm start` - build the plugin and start the Medusa dev server and plugin watcher
- `npm run build -w medusa-plugin-wordpress` - build the Medusa plugin
- `npm run watch -w medusa-plugin-wordpress` - start the Medusa plugin watcher
- `npm run test -w medusa-plugin-wordpress` - run Medusa plugin tests
- `npm run seed -w medusa` - seed Medusa DB
- `npm run build -w medusa` - build Medusa
- `npm run migrate -w medusa` - run Medusa migrations
- `npm start -w medusa` - start the Medusa development server
- `npm run addcert -w wordpress` - add a self-signed certificate for `medusawp.test`
- `npm run build -w wordpress` - build WordPress

#### Docker Services

[](#docker-services)

Docker services are defined in `docker-compose.yml` file. There are 2 separate profiles defined in the file:

- `wp` - WordPress
- `medusa` - Medusa

Most of the time, you will want to run both profiles at the same time. But if you want to run only one of them, you can do so by running `docker-compose --profile  up`. For example, to start only WordPress, you would run `docker-compose --profile wp up`.

##### WordPress

[](#wordpress)

- `nginx` - Nginx web server that serves WordPress on
- `php` - PHP-FPM
- `db` - MariaDB database server for WordPress available on localhost:3306, you can change credentials and port in `.env` file
- `phpmyadmin` - phpMyAdmin available on

##### Medusa

[](#medusa)

- `postgres` - PostgreSQL database server for Medusa available on localhost:5432, you can change credentials and port in `.env` and `dev/medusa/.env` files
- `pgadmin` - pgAdmin available on
- `redis` - Redis server for Medusa available on localhost:6379
- `admin` - Medusa Admin available on

Additional Resources
--------------------

[](#additional-resources)

- [Medusa Documentation](https://docs.medusajs.com/)
- [Medusa Development Documentation](https://docs.medusajs.com/development/overview)
- [WordPress Documentation](https://wordpress.org/documentation/)
- [WordPress Developer Resources](https://developer.wordpress.org/)

License
-------

[](#license)

This project is licensed under the [MIT License](./LICENSE).

Credits
-------

[](#credits)

MedusaWP is developed and maintained by [AGILO](https://agilo.co/). Huge thanks to [all contributors](https://github.com/Agilo/medusawp/graphs/contributors).

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~21 days

Recently: every ~26 days

Total

6

Last Release

793d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/698a5a2ceafb3307ba7a284b3f59b2d13f763a6ec30327e9542d006eed5db683?d=identicon)[agilo](/maintainers/agilo)

---

Top Contributors

[![ilimic1](https://avatars.githubusercontent.com/u/9499343?v=4)](https://github.com/ilimic1 "ilimic1 (4 commits)")

---

Tags

wordpressheadlessecommercestorefrontmedusa

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/agilo-medusawp/health.svg)

```
[![Health](https://phpackages.com/badges/agilo-medusawp/health.svg)](https://phpackages.com/packages/agilo-medusawp)
```

###  Alternatives

[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[silverstripe/framework

The SilverStripe framework

7213.5M2.5k](/packages/silverstripe-framework)[themosis/framework

The Themosis framework.

676307.9k18](/packages/themosis-framework)[aimeos/aimeos-headless

Aimeos headless ecommerce system

2.5k2.3k](/packages/aimeos-aimeos-headless)[yupe/yupe

Yupe is simple and lightweight CMF for web-development, built on top of Yii 1.x

5955.5k](/packages/yupe-yupe)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
