Content Features
The Content group controls optional content features displayed on post pages and how WordPress HTML content is processed before being rendered.
Admin path: Stores > Configuration > Orange Collar > WordPress Integration > Content
Settings
Enable Related Posts
Displays a list of related posts at the bottom of each post page.
- Default: No (disabled)
- Related posts are fetched from the WordPress
oc-bridge/v1/related/{post_id}endpoint - The plugin finds related posts by shared tags first, then falls back to shared categories
Related Posts Count
How many related posts to display.
- Default: 5
Enable Social Sharing
Shows social sharing links (Twitter/X, Facebook, LinkedIn) on post pages.
- Default: No (disabled)
- Links use the canonical post URL on the Magento side
Enable Author Pages
Enables author archive pages at /blog/author/{slug}.
- Default: No (disabled)
- When disabled, author name links in templates do not link to an archive page
Content Processing
All post content returned from the WordPress REST API goes through the ContentProcessor before being rendered. This is a four-step pipeline:
Step 1: Link Rewriting
Internal WordPress links (links pointing to the WordPress domain) are rewritten to use the Magento blog URL. For example, a link to https://blog.example.com/my-post becomes /blog/my-post.
Date-based permalink prefixes (e.g., /2024/01/15/) are stripped during rewriting so the simpler post-name URL is used.
Step 2: Lazy Loading
loading="lazy" is added to all <img> tags that do not already have a loading attribute. This improves initial page load performance for post content with many images.
Step 3: Shortcode Stripping
Any remaining WordPress shortcodes (e.g., [gallery], [caption]) that were not processed by WordPress into HTML are stripped from the output. This prevents raw shortcode text appearing on the page.
Step 4: HTML Sanitization
Dangerous HTML constructs are removed:
<script>blocks (including content)<style>blocks (including content)on*event handler attributes (e.g.,onclick,onload)javascript:protocol inhref,src, andactionattributes
This is a basic sanitization pass. For high-security contexts, consider adding HTMLPurifier as a post-processing step.