Init Embed Posts – Lightweight and Beautiful WordPress Embeds Without iFrame

Version: 1.6 Tiếng Việt

Init Embed Posts – Lightweight and Beautiful WordPress Embeds Without iFrame
Init Embed Posts lets you embed your WordPress posts on any external website with just a simple code snippet. No iframe, no oEmbed, no third-party platforms — just a lightweight script that gives you full control over how your content is displayed. The plugin is optimized for performance, flexibility, and a modern user experience.

Key Features

  • Embed WordPress posts or WooCommerce products using a lightweight script with a custom optimized REST API
  • No iframe, no oEmbed, no third-party dependencies
  • Modern card layout that looks great everywhere:
    • For posts: favicon, site name, title, excerpt, up to 5 preview images
    • For products: featured image, product name, price, sale price (with strikethrough), and “Add to cart” button
  • Skeleton loading while fetching data – smooth experience, no flicker
  • Auto-detects light/dark mode based on the embedding site
  • Built-in modal UI in the editor to generate and copy embed code easily
  • Pure Vanilla JS – no jQuery, no external libraries
  • Immutable JSON output – perfect for CDN and cache (e.g., Cloudflare)
  • Separate scripts: init-embed.js for posts, init-embed-product.js for products
  • Supports data-type="product" attribute to detect content type in embed code
  • Optional: auto-insert “Embed Product” button after product meta in WooCommerce
  • Includes hooks & filters for developers to customize appearance and data

How to Use

  1. Activate the plugin as usual
  2. Add the shortcode [init_embed_code] in any post or product to display the “Copy Embed Code” button
  3. Click the button → open modal → configure options → copy the code
  4. Paste the code into any external site where you want to show the content

Example Embed Code

<!-- Embed a post -->
<div class="init-embed" data-id="123" data-origin="https://example.com"></div>
<script async src="https://example.com/wp-content/plugins/init-embed-posts/assets/js/init-embed.js?v=1.3"></script>

<!-- Embed a WooCommerce product -->
<div class="init-embed-product" data-id="456" data-type="product" data-origin="https://example.com"></div>
<script async src="https://example.com/wp-content/plugins/init-embed-posts/assets/js/init-embed-product.js?v=1.3"></script>

Demo: Embedding Posts & Products

You can easily embed posts or products from other sites using a simple HTML snippet. Here’s an example of embedding a post:

Compatibility & Performance

  • Requires WordPress 5.5 or higher
  • Supports PHP 7.4 or newer
  • Works with all popular themes (Astra, Blocksy, Kadence…)
  • No custom database tables, no tracking, no bloat

For Developers

  • init_plugin_suite_embed_posts_rest_response: modify the JSON response of embedded posts
  • init_plugin_suite_embed_products_rest_response: modify the JSON response of embedded WooCommerce products
  • init_plugin_suite_embed_posts_excerpt: customize the excerpt content of embedded posts
  • init_plugin_suite_embed_products_excerpt: customize the excerpt content of embedded products
  • init_plugin_suite_embed_posts_images: override the image list used in embedded posts
  • init_plugin_suite_embed_posts_favicon_url: change the favicon URL shown in the embed card
  • init_plugin_suite_embed_posts_view_count_keys: customize the list of post meta keys used to detect view count (ordered by priority)
  • init_embed_insert_locations: control where the “Copy Embed Code” button appears on the frontend

Explore the The Complete Guide to Init Live Search to dive into detailed guides and advanced use cases.

Get Started

No more outdated iframes or complicated APIs. Init Embed Posts gives you a clean, beautiful, and fully controlled way to share your WordPress content anywhere.

Review

5.0/5 (4)

Changelog

  • 1.6 – Fix duplicated embed settings when using shortcode multiple times
    • Fixed an issue where InitEmbedPostsSettings was output multiple times when the embed shortcode appeared more than once on the same page.
    • Ensured embed UI scripts and localized settings are initialized only once per request.
    • Improved overall stability when the embed button is auto-injected at multiple content locations.
  • 1.5 – Improved image handling & REST API hardening
    • Enhanced init_plugin_suite_embed_posts_extract_images() for more reliable and consistent image extraction.
    • Filtered out invalid sources such as data: and blob: URLs to prevent broken previews in embed cards.
    • Added URL sanitization and duplicate checks to ensure only clean, valid image URLs are returned.
    • Improved image limiting logic for stable output regardless of content complexity.
    • Minor internal REST API refinements for better stability across external embed requests.
  • 1.4 – Add filter for shortcode button
    • Added init_embed_posts_shortcode_html filter to customize the shortcode button HTML.
    • Allows developers to fully override the embed button markup and styling.
    • Improved extensibility for theme and plugin developers.
  • 1.3 – Full modal UI in JS, added review & meta support
    • Replaced the entire embed modal UI with dynamic JavaScript – no more PHP template needed.
    • Added 2 new options: Show post info and Show review.
    • Post info displays publish time, views, and comments – with nice icons.
    • If Init Review System plugin is installed, it will display 5-star ratings and the average score.
    • API now returns comment_count, view_count and review.
    • Automatically fetches view count from popular plugins (Jetpack, WP-PostViews, WP Statistics…).
    • View meta can be customized via init_plugin_suite_embed_posts_view_count_keys filter.
    • Publish time returned in “3 days” style (no need for JS-side handling).
    • Script init-embed-ui.js only loads when shortcode is present – performance optimized.
  • 1.2 – Cleanup and optimize default theme
    • Added uninstall.php file to remove settings when plugin is uninstalled.
    • Changed default theme from auto to light to prevent issues on sites without dark mode support.
  • 1.1 – WooCommerce product embedding
    • Supports embedding WooCommerce products with product card layout.
    • Displays product image, name, price and sale price (with strike-through effect).
    • Supports “Add to cart” button.
    • Uses separate script init-embed-product.js – fully independent from post embed.
    • Embed code includes data-type="product" to identify content type.
    • Option to auto-insert “Embed product” button after product meta (toggle on/off).
  • 1.0 – First release of Init Embed Posts
    • Embed WordPress posts on any website with a simple script, no iframe needed.
    • Modern post card UI: favicon, domain, title, excerpt, and up to 5 preview images.
    • Auto-detects dark/light mode from the embedding site.
    • Supports skeleton loading while fetching API data.
    • User-friendly modal UI in editor to quickly copy embed code.
    • Built entirely with Vanilla JS, no jQuery, no external dependencies.
    • Dedicated REST API returns stable JSON – optimized for cache/CDN like Cloudflare.
    • Includes filters & hooks for customizing embed card data and UI.
    • No new tables, no logs, no tracking – super lightweight plugin, works everywhere.
Made with in HCMC.

Comments


1 comments
  • Admin

    10/06/2025 lúc 15:45

    Live demo right on this page! You can grab the embed code from the post meta (below the featured image) of any post and embed it anywhere you like! 😊

Init Toolbox

Press Ctrl + \ on desktop, or swipe left anywhere on mobile.

Login