WordPress Integration - Overview
The OrangeCollar 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.
How It Works
Section titled “How It Works”The integration has two parts:
- Magento module (
OrangeCollar_WordPressIntegration) - intercepts blog URLs, fetches content from WordPress, caches it, and renders it using Magento layout/templates - WordPress plugin (
oc-magento-bridge) - 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 -> oc-magento-bridge fires webhook POST -> Magento verifies HMAC-SHA256 signature -> Purges relevant cache tagsRequirements
Section titled “Requirements”| Requirement | Version |
|---|---|
| PHP | 8.1 or higher |
| Magento | 2.4.8 or higher |
| WordPress | 6.0 or higher |
| OC Magento Bridge plugin | Latest |
What It Renders
Section titled “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
Section titled “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 oc-magento-bridge plugin sends a webhook to Magento that purges only the affected cache entries - so your visitors always see fresh content without the overhead of disabling caching entirely.
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.