Skip to content

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

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

How many related posts to display.

  • Default: 5

Shows social sharing links (Twitter/X, Facebook, LinkedIn) on post pages.

  • Default: No (disabled)
  • Links use the canonical post URL on the Magento side

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

All post content returned from the WordPress REST API goes through the ContentProcessor before being rendered. This is a four-step pipeline:

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.

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.

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.

Dangerous HTML constructs are removed:

  • <script> blocks (including content)
  • <style> blocks (including content)
  • on* event handler attributes (e.g., onclick, onload)
  • javascript: protocol in href, src, and action attributes

Note: This is a basic sanitization pass. For high-security contexts, consider adding HTMLPurifier as a post-processing step.