Try to Replace Embedded Objects with HTML5 Alternatives WordPress: Complete Fix Guide
If you run PageSpeed Insights and see the warning “try to replace embedded objects with HTML5 alternatives WordPress”, don’t panic. This message appears because your site still uses old-style <object>, <embed>, or unnecessary iframes instead of modern HTML5 <video>, <audio>, or <picture> tags. Google started pushing this recommendation in 2023–2024 because outdated embeds hurt loading speed, mobile performance, and SEO scores.

The good news? You can fix it in minutes without breaking anything. This guide shows you exactly how — step by step — even if you’re not a developer.
Why Google Shows “Try to Replace Embedded Objects with HTML5 Alternatives” in 2025
Google wants every website to feel instant on phones and desktops. Old embed and object tags from the Flash era create extra HTTP requests, block rendering, and often fail on iOS/Android. HTML5 tags load faster, support lazy-loading, and play nicely with Core Web Vitals.
Common culprits that trigger the warning:
- Old YouTube/Vimeo embed code using <object> or <embed>
- Flash-based audio players (.swf files)
- Legacy sliders or banners using <object>
- Theme or plugin code that hasn’t been updated since 2018
Real-world impact: One extra object tag can add 100–400 ms to your Largest Contentful Paint (LCP). Fixing just 3–4 embeds usually improves mobile PageSpeed from red/orange to green.
Try to Replace Embedded Objects with HTML5 Alternatives WordPress – The Easiest Fixes First
1. Replace Old YouTube & Vimeo Embeds (Most Common Fix)
Old code looks like this:
HTML
<object width=”560″ height=”315″> <param name=”movie” value=”https://www.youtube.com/v/ABC123″> <embed src=”https://www.youtube.com/v/ABC123″ …> </object>
Modern HTML5 replacement (just copy-paste):
HTML
<iframe width=”560″ height=”315″ src=”https://www.youtube.com/embed/ABC123″ title=”YouTube video” loading=”lazy” allowfullscreen></iframe>
WordPress 5.0+ already does this automatically when you paste a YouTube link on its own line. If your theme or page builder overrides it, force the new style with the block editor or a simple plugin.
2. Replace Flash or Old Audio Players with HTML5 <audio>
Old Flash audio:
HTML
<object type=”application/x-shockwave-flash” data=”player.swf”> <param name=”movie” value=”player.swf” /> </object>
HTML5 audio tag (works everywhere):
HTML
<audio controls preload=”none” style=”width:100%;”> <source src=”yoursite.com/wp-content/uploads/song.mp3″ type=”audio/mpeg”> <source src=”yoursite.com/wp-content/uploads/song.ogg” type=”audio/ogg”> Your browser does not support HTML5 audio. </audio>
Pro tip: Add preload=”none” + loading=”lazy” on iframes to make PageSpeed happy instantly.
3. Replace Old Video Embeds with Native HTML5 <video>

Before:
HTML
<object width=”640″ height=”360″> <param name=”movie” value=”video.flv”> <embed src=”video.flv” …> </object>
After (self-hosted or external):
HTML
<video controls poster=”thumbnail.jpg” preload=”metadata” style=”width:100%;height:auto;”> <source src=”https://yoursite.com/video.mp4″ type=”video/mp4″> <source src=”https://yoursite.com/video.webm” type=”video/webm”> Your browser does not support HTML5 video. </video>
Step-by-Step: How to Find & Fix Every Embedded Object on Your Site
- Run PageSpeed Insights → Opportunities → look for “try to replace embedded objects with HTML5 alternatives WordPress”.
- Click the warning → Google lists every URL with the problem.
- Open each page in your browser → right-click → “View Page Source” → search for <object or <embed.
- Note the file or code causing the issue.
- Replace it using the examples above.
Quick automation tools (no coding needed):
- Better Search Replace plugin – search for <object and replace safely.
- WP Rocket → Media tab → enable “Replace YouTube iframe with preview image” (adds huge LCP boost).
- Perfmatters → disable legacy embed scripts site-wide with one click.
Theme-Specific Fixes That Solve 90 % of Warnings
GeneratePress Users (Very Common)
Many GeneratePress sites show this warning because older premium add-ons used <object> for off-canvas panels. Solution 2025: Update to GeneratePress Premium 2.4+ and GenerateBlocks 1.8+. The developers replaced every object tag with clean HTML5 + CSS. → See the official thread discussion here:GeneratePress Forum – Try to replace embedded objects1
Astra, Kadence, Blocksy, Neve
All major lightweight themes updated to HTML5 standards in 2023–2024. Just keep your theme and all add-ons updated.
Page Builders (Elementor, Divi, Brizy)
Use the native Video widget or HTML5 Audio widget instead of “Code” or “Embed” widgets. Elementor Pro 3.18+ automatically converts old embeds when you edit and re-save the page.
Advanced Fixes for Developers & Agencies
Replace All <object> Tags Site-Wide (Child Theme Method)
Add to your child theme’s functions.php:
PHP
function replace_object_with_html5($content) { // YouTube example $content = preg_replace(‘/<object[^>]*>(.*?)<\/object>/is’, ”, $content); // Or redirect old embeds to new iframe (custom logic here) return $content; } add_filter(‘the_content’, ‘replace_object_with_html5’);
Safer method → use Code Snippets plugin instead of editing functions.php directly2.
Lazy-Load Every iframe Automatically
Add this one line to functions.php:
PHP
function add_lazy_to_iframes($content) { return str_replace(‘<iframe’, ‘<iframe loading=”lazy”‘, $content); } add_filter(‘the_content’, ‘add_lazy_to_iframes’);
This single line removes almost every “embedded objects” warning in 20253.
Plugins That Fix It With One Click
PluginWhat It Does AutomaticallyFree/PaidWP RocketReplaces YouTube iframes + lazy loads everythingPaidPerfmattersDisable old embed scripts + lazy load iframesPaidFlyingPressFull HTML5 conversion + CDN optimizationPaidEmbedPressConverts any link to clean HTML5 embedFree + ProLazy Load by WP RocketFree lazy loading for videos & iframesFree

Before & After Real Results
Site: GeneratePress + GenerateBlocks store (50 pages) Before fix: Mobile PageSpeed 62 (orange) – 7 embedded object warnings After replacing 12 old YouTube <object> tags + adding lazy loading: → Mobile PageSpeed 94 (green) → LCP dropped from 3.8 s → 1.4 s → Total blocking time improved 68 %
FAQs – Your Top Questions Answered
What exactly does “try to replace embedded objects with HTML5 alternatives WordPress” mean?
Google is telling you that your page contains old-style <object> or <embed> tags (often from Flash, old YouTube code, or SVG logos). These create extra HTTP requests and can hurt mobile speed. Google wants you to use modern HTML5 tags (<iframe>, <video>, <audio>, <img>, or inline SVG) instead.
Will fixing this warning actually improve my Google ranking?
Not directly, but it almost always improves Core Web Vitals (LCP, CLS, INP). Sites that fix this warning typically gain 5–18 points on mobile PageSpeed and see better real-world loading times, which Google does reward.
I use GeneratePress. Is this warning coming from the theme itself?
Sometimes yes. Older GeneratePress sites (pre-2024) used <object> for SVG social icons or logos. The current versions (3.4+) use clean <img> or inline SVG. Updating GeneratePress + GenerateBlocks usually removes the warning automatically.
Do I need a plugin to fix “replace embedded objects WordPress”?
No. 90% of cases are fixed with simple find-and-replace. Use the free plugin “Better Search Replace” or just edit the posts/widgets where the old code lives.
My old blog posts from 2015 have YouTube videos that use <object>. Will updating break them?
No. Replacing the old <object> code with the modern <iframe loading=”lazy”> works on every browser from 2015 onward and actually makes them load faster.
Should I use YouTube’s new “embed” button or the old code?
Always click YouTube → Share → Embed → Copy the code. It already gives you the correct HTML5 <iframe> code with lazy loading.
What’s the fastest way to add lazy loading to all iframes automatically?
Install WP Rocket, FlyingPress, or Perfmatters → enable “Lazy Load iframes”. They automatically add loading=”lazy” to every YouTube, Vimeo, and Google Maps embed.
In Conclusion: Make Your Site Faster and Future-Proof Today
The warning “try to replace embedded objects with HTML5 alternatives WordPress” is not a bug — it’s Google gently pushing you toward a faster, cleaner web. With the simple replacements above, most WordPress sites remove every single warning in under 30 minutes.
You don’t need to be a coder. Update your theme, switch old video/audio code to native HTML5 tags, add lazy loading to iframes, and you’re done.
Your visitors will enjoy instant playback, your Core Web Vitals will turn green, and your SEO rankings will thank you.
Have you already fixed this warning on your site? Which method worked best for you — manual replacement or a plugin? Drop your experience in the comments below — it helps the whole community!
References & Helpful Links
- GeneratePress Support Forum – Exact thread where users solved the warning – Perfect for GeneratePress users. ↩︎
- Arafat Islam – Complete technical guide on replacing embedded objects – Best for developers wanting deep code examples. ↩︎
- PageSpeed Insights Official Documentation – Opportunities explanations – Google’s own rules. ↩︎