MrSeokar Inline Related Products for WooCommerce

Description

MrSeokar Inline Related Products for WooCommerce automatically shows related products inside your blog posts: between the headings, paragraphs or images of every article, exactly where readers are paying attention. No shortcodes, no snippets, no editing posts one by one.

Activate the plugin, pick a style, and every post starts recommending matching products. Want full control over an important article? Choose its products by hand from the post editor.

Who is it for?

  • Online stores with a blog – show your products right inside your articles.
  • Affiliate sites – list your affiliate offers as WooCommerce external/affiliate products and show them automatically in every review, guide and comparison post. The buy button can go straight to the affiliate link with rel="sponsored nofollow".
  • Content sites – add product recommendations to existing articles without editing them.

Features

  • Show related products in blog posts automatically – before every heading (H2 to H6), paragraph or image, or every other one.
  • Seven product matching methods – a product category named in the post title (checked from the first or the last word), a product category with the same name as the post’s blog category (first or last match), product search with the title words (first or last words first) or with the Yoast SEO / Rank Math focus keyword. Every method is explained with an example on the settings page.
  • Works in any language – punctuation and small words (and, of, the, و، در، به…) are removed, letter case, half-spaces and Arabic/Persian letter forms are ignored.
  • Per-post control from one simple box – search and pick products, choose a product category, or turn products off for a single post. No snippets needed, even with hundreds of posts.
  • Affiliate ready – external/affiliate products link directly to the affiliate URL with the product’s own button text.
  • Four responsive designs – vertical card, horizontal row, text over image, image beside details.
  • Simple, variable, grouped and external products – sale prices and price ranges use your WooCommerce currency and tax settings.
  • Fully customizable – button text, label text (“You May Also Like”), colors, product name tag, new-tab links.
  • Skips unavailable products – out-of-stock, hidden and zero-price products are not shown (optional).
  • Works with any theme and page builder – Elementor, Elementor Pro theme builder, the block editor (Gutenberg), Classic Editor, WPBakery, Divi, Beaver Builder, Bricks, Oxygen and block themes. Your article markup is read with the WordPress HTML API and never rebuilt.
  • Built for speed – the product boxes of each post are cached with the post, so after the first view the plugin adds zero database queries. The cache clears itself when products, prices, stock or settings change, and a “Clear cache” button is included.
  • SEO friendly – product names use a paragraph tag by default, so they never pollute your heading structure or table of contents.
  • RTL and multilingual – works in left-to-right and right-to-left languages; English and Persian included, translation ready.
  • Lightweight and private – no tracking, no external requests, no ads in your dashboard.

How related products are found

  1. Products or a product category chosen in the post’s Inline Products box always come first.
  2. Otherwise the method selected in the settings is used:
    • Category named in the post title (from the first / last word) – the title is split into words, punctuation and small words are removed. Single words are compared with your product category names first, then pairs of neighbouring words, then groups of three; the first exact match wins. Example: “Barbecue types compared: gas, charcoal, brick and electric” from the first word, the “Barbecue” category is used; from the last word, “Charcoal” (if it exists) is found first.
    • Blog category of the post (first / last match) – the title is not used. The post’s blog categories are compared with your product category names; the first (or last) exact match wins, then their parent categories are checked.
    • Product search with the title words (first / last words first) – each title word is searched in product names and descriptions; categories are not used.
    • Product search with the focus keyword – the Yoast SEO or Rank Math focus keyword is searched.
  3. If the method finds nothing, the When nothing is found setting either searches product names with the title words or shows no products.
  4. Out-of-stock, hidden and zero-price products are skipped (unless you allow them).

Pro version (coming soon)

A separate Pro add-on is planned with: product order (cheapest, most expensive, best selling, most popular, most reviewed, most relevant), grid and slider layouts, AJAX add to cart, ratings and discount badges, shortcode and block, rules per blog category, global exclusions and click statistics. This free plugin is complete on its own and contains none of these features; they are only listed on the settings page for information.

Privacy

This plugin does not collect any data, does not set cookies and does not connect to any external service.

For developers

Filters: mrseokar_ip_should_insert, mrseokar_ip_post_types, mrseokar_ip_product_ids, mrseokar_ip_keywords, mrseokar_ip_focus_keyword, mrseokar_ip_product_html, mrseokar_ip_cache_ttl, mrseokar_ip_content_priority.

Example – never show products in the “news” category:

add_filter( 'mrseokar_ip_should_insert', function ( $insert, $post_id ) { return has_category( 'news', $post_id ) ? false : $insert; }, 10, 2 );

Author

Made by Ebrahim Hanafi (MrSeokar). Documentation: Inline products in blog posts.

WooCommerce is a trademark of Automattic Inc. This plugin is not affiliated with or endorsed by Automattic.

Screenshots

Installation

  1. Make sure WooCommerce is installed and active.
  2. Go to Plugins Add New, search for “MrSeokar Inline Related Products”, then install and activate it.
  3. Go to WooCommerce Inline Products, choose where products appear and how they look, and save.
  4. Open any blog post – related products are already shown inside the content.

FAQ

How do I show related products in a WordPress blog post?

Install the plugin and activate it. Related WooCommerce products are added inside every blog post automatically, before the headings of the article by default. You can change the position, the number of products and the design in WooCommerce Inline Products.

Can I use it for an affiliate site?

Yes. Add your offers as WooCommerce “External/Affiliate” products. They are shown inside your articles like any other product, and the buy button can go straight to the affiliate link with rel="sponsored nofollow".

Can I choose the products of a single post?

Yes. Edit the post and use the Inline Products box under the editor: search and pick products, choose a product category, or tick Do not show products in this post. There is no need to create snippets or shortcodes for each post.

Does it work with Elementor?

Yes. It works with posts built with Elementor and with single post templates made in Elementor Pro’s theme builder (Post Content widget). Products are not added inside the Elementor editor, only on the live page.

Does it slow down my site?

No. Related products are searched only on the first view of a post. The finished boxes are stored with the post and reused without any extra database query until something changes (a product, its price or stock, a category, the post or the plugin settings) or the cache time you chose passes.

No products appear in my post. Why?

  • The post type is selected in Show products in (Posts by default).
  • The article contains the tag chosen in Insert products before (for example Heading 2). If your sections use Heading 3, choose Heading 3.
  • Matching products exist. If the title words match no product, choose products or a category in the post’s Inline Products box.
  • The products are in stock and have a price, or Out-of-stock products is enabled.
  • You just changed products outside WooCommerce: click Clear cache.

Does it change my posts?

No. Nothing is written into your post content. Products are added only when a post is displayed, so deactivating the plugin removes them everywhere.

Products appear in my table of contents.

Set HTML tag of the product name to “p” (the default). Heading tags make product names part of the article outline.

Is it compatible with caching and SEO plugins?

Yes. The output is normal HTML that page caches store like the rest of the article, and it works alongside Yoast SEO, Rank Math and table-of-contents plugins.

Where can I get help?

Use the support forum of the plugin on WordPress.org or visit ehm.ir.

Reviews

There are no reviews for this plugin.

Contributors & Developers

“MrSeokar Inline Related Products for WooCommerce” is open source software. The following people have contributed to this plugin.

Contributors

Changelog

2.1.0

  • New: “Category named in the post title” methods – single words, then pairs, then groups of three, from the first or the last word, with exact name matching.
  • New: “Blog category of the post” methods – use the product category that has the same name as the post’s blog category (first or last match, parent categories as fallback).
  • New: “When nothing is found” setting.
  • New: visual style picker with a preview of every style.
  • New: explanation and example for every finding method on the settings page.
  • Improved: titles and category names are compared in any language (punctuation, small words, letter case, half-spaces and Arabic/Persian letter forms are ignored).
  • The old “Smart” method now uses the new “Category named in the post title – from the first word” method.

2.0.1

  • Main plugin file renamed to mrseokar-inline-products.php (sites updating from 1.x are switched automatically).
  • Readme clarified.

2.0.0

  • Renamed to “MrSeokar Inline Related Products for WooCommerce” and prepared for WordPress.org.
  • New: affiliate mode – external products link straight to the affiliate URL (rel=”sponsored nofollow”).
  • New: per-post cache of the product boxes with automatic invalidation and a “Clear cache” button: no extra database queries after the first view.
  • New: the content is read with the WordPress HTML API (WordPress 6.2+), with a built-in fallback for older versions.
  • New: choose products with WooCommerce’s product search in the post editor.
  • New: turn products off for a single post.
  • New: choose the post types where products appear.
  • New: open products in a new tab (optional).
  • New: right-to-left and left-to-right layouts.
  • New: compatible with WooCommerce High-Performance Order Storage.
  • Fixed: fatal error on large pages, for example posts built with Elementor.
  • Fixed: an empty post could be displayed when the content could not be processed.
  • Fixed: fatal error with variable products.
  • Fixed: fatal error when WooCommerce is not active.
  • Fixed: products were inserted inside links, lists and tables.
  • Fixed: products were added to related-post widgets and page-builder templates.
  • Fixed: “Every other” position setting skipped half of the products.
  • Fixed: hiding out-of-stock products did not work.
  • Fixed: the regular price was shown crossed out even when the product was not on sale.
  • Fixed: color picker not loading.
  • Improved: all settings stored in one option; every input sanitized and every output escaped.
  • Removed: the bundled HTML parser library, remote images and the dashboard-wide notice.
  • Settings of version 1.x are migrated automatically.

1.2

  • Focus keyword and smart category detection methods.