Render WordPress blog content on your Magento 2 storefront
The OCMLabs WordPress Integration module renders WordPress blog content (posts, categories, tags, menus, and more) directly on your Magento 2 storefront. All content is fetched from WordPress via the REST API - there is no shared database between the two systems.
The Magento 2 WordPress integration extension is available from the OCM Labs store as a one-time purchase with 12 months of updates and support.
How it works
The integration has two parts:
- Magento module (
OCMLabs_WordPressIntegration) - intercepts blog URLs, fetches content from WordPress, caches it, and renders it using Magento layout/templates - WordPress plugin (
ocmlabs-content-bridge-for-magento) - exposes custom REST API endpoints and sends cache-purge webhooks to Magento when content changes
Magento storefront (/blog/*)
-> Router (intercepts blog URLs at sortOrder 25)
-> Repositories (PostRepository, CategoryRepository, etc.)
-> API Client (Guzzle HTTP)
-> WordPress REST API
/wp-json/wp/v2/* (core WP endpoints, no auth)
/wp-json/oc-bridge/v1/* (custom plugin endpoints, X-OC-Bridge-Key header)
WordPress content change
-> ocmlabs-content-bridge-for-magento fires webhook POST
-> Magento verifies HMAC-SHA256 signature
-> Purges relevant cache tags Requirements
- MODULE
- OCMLabs_WordPressIntegration (Composer: ocmlabs/module-wordpress)
- MAGENTO
- 2.4.8 - 2.4.9, Open Source and Adobe Commerce
- PHP
- 8.3 - 8.4
- WORDPRESS
- 6.0 or higher
- OCMLABS CONTENT BRIDGE PLUGIN
- Free on WordPress.org
What it renders
- Blog post listing with pagination
- Single post pages with featured image, author, categories, and tags
- Category archive pages
- Tag archive pages
- Author archive pages
- Search results
- WordPress navigation menus (optional)
Content is cached
All WordPress API responses are cached in Magento’s cache backend using tagged cache entries. The default cache lifetime is 1800 seconds (30 minutes) for posts and 86400 seconds (24 hours) for categories and tags.
When you publish or update content in WordPress, the Content Bridge plugin sends a webhook to Magento that purges only the affected cache entries, including the cached blog pages in the full page cache (built-in or Varnish). Visitors see the change on the next page load, without the overhead of disabling caching entirely.
SEO
When enabled, the module pulls SEO metadata (meta title, description, Open Graph tags, Twitter Card tags, and JSON-LD Article schema) directly from Yoast SEO or RankMath in WordPress and applies it to the corresponding Magento page.
Documentation guide
Start with installation and the connection, then pick the sections you need. Every page in this module is listed below.
Set it up
- Install the Magento module and the WordPress plugin - Composer commands, the Hyva companion package, and how to check
/blogloads. - Install and activate the OCMLabs Content Bridge for Magento plugin on the WordPress side.
- Connect Magento to WordPress with the WordPress URL, API key, timeout and Test Connection button.
Configure the blog
- Blog base URL, posts per page and default post image.
- Yoast and RankMath SEO meta, Open Graph and breadcrumbs.
- WordPress navigation menus in Magento layouts.
- Cache lifetimes and webhook cache purging.
- Related posts, social sharing, author pages and content processing.
Storefront features
- CMS widgets for recent, featured and category posts.
- Sidebar blocks for categories, tags, archive, search and recent posts.
- Connect each store view to its own WordPress site.
- Templates, ViewModels and theme overrides.
- Hyva templates built with Tailwind CSS and Alpine.js.
The WordPress plugin
- Plugin settings: API key and Magento webhook URL.
- The oc-bridge/v1 REST endpoints for menus, SEO, sidebars and related posts.
- Signed cache-purge webhooks sent from WordPress.
- Advanced Custom Fields data in REST responses.
For developers
- Module architecture, DI and request flow.
- PHP API reference for the client, data models and repositories.
- Data flow from request to cached response.
- Extending the module with plugins, preferences and custom widgets.
- How the router resolves blog URLs.
- The content processing pipeline that rewrites links and sanitizes post HTML.
Reference
- Every configuration path under
ocmlabs_wordpress/. - Cache tags and manual purging.
- The WarmCache and SyncCategories cron jobs.
- Layout handles for each blog page type.
- Troubleshooting 404s, 403s, blank content and webhook failures.
Links
Get WordPress Integration on the OCM Labs store, or browse all OCM Labs Magento extensions. The agency behind the modules offers installation and upgrade help and custom module work.