Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

WordPress does not have one universal “disable embeds” switch. To stop a single service, remove that provider from the oEmbed registry with wp_oembed_remove_provider(). To suppress the legacy front-end host script, unhook wp_oembed_add_host_js from wp_head. These controls affect different layers: neither one rewrites iframe markup already saved in posts, and neither automatically removes assets loaded inside an embed iframe.

Choose the narrowest change that matches your goal, then verify it on a page containing a real post embed. Since WordPress 5.9, wp-embed is conditionally enqueued only when generated HTML contains post-embed markup, so testing an ordinary page can produce a misleading “nothing changed” result.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What WordPress means by an embed

WordPress uses the oEmbed protocol to turn a URL into provider-supplied HTML. The protocol covers videos, images, text and other media. WordPress keeps an internal whitelist of providers that it is willing to query, so an embed is the result of several stages rather than one switch:

  • A URL is recognized as belonging to a registered provider.
  • WordPress requests or generates the provider’s embed HTML.
  • The resulting markup is inserted into post content or a block.
  • If the markup is a WordPress post embed, WordPress may enqueue wp-embed so the host page can communicate with the embed iframe.
  • The iframe can load its own scripts, styles and template independently of the host page.

That separation explains why “disable embeds” can mean different things. Removing a provider stops that provider from being accepted through the oEmbed registration you target. Removing the host callback targets WordPress’s communication script. Neither operation is a content migration, and neither is a blanket blocker for every iframe a plugin or theme might print.

#1 Best Overall
Sale
Compressed Air Duster,130000RPM Super Power Cordless Air Duster,Rechargeable Brushless Blower,3 Gear Adjustable Blower with LED Light,Dust Remover for Computer/House/Outdoor/Car
  • Powerful Turbo Fan:CAGIWIRU Electric Air Duster have reached speed up to 130000RPM,Can efficient remove dust and debris.With LED light and Three Adjustable Speed to meet with different cleaning tasks.
  • With Attached USB C Fasting Charging cable.Charing 3 hours,Enjoy up to 240 minutes of use on the lowest setting, For third speed can use for 25mins.with four charging options to meet with your needs.
  • Wide Application:Upgraded attached 5 different nozzles,making it suitable for a variety of scenes, such as car,pet, pc, keyboards, and other electronic devices. It also serves for office and home clean duster.
  • Handy Design & Portable:Cordless air duster electric nozzle is Light weight and small size, design and comfortable to hold and space saving, convenient to carry around. You can put it in your room or inside the car without taking up space.
  • Warranty & Support: Our Electric air duster comes with 5 years warranty and 24/7 customer service. During this period, if you have any questions,pls kindly feel free to contact us.

Pick the control that matches your goal

Method Scope What it changes What it does not change Best fit
Remove one oEmbed provider One registered provider or URL pattern Provider recognition and oEmbed handling for the entry you remove Other providers, existing saved iframe markup, and custom iframe output Blocking one service while keeping other embeds
Remove wp_oembed_add_host_js WordPress host-page script path The legacy callback that adds host-side oEmbed JavaScript Provider registration, saved markup, iframe assets, and plugin-generated scripts Suppressing the host communication script when that is the specific requirement
Inspect enqueue_embed_scripts Scripts and styles queued for the embed iframe Iframe-side assets registered through the embed enqueue layer Host-page output and saved post content Changing the iframe’s own stylesheet or scripts
Edit or migrate post content Markup already stored in posts Existing iframe or block HTML Future provider registration and unrelated generated output Removing embeds that are already saved in content

Provider removal is the narrowest option when one service is unwanted. Host-script removal is broader in effect on the front end, but it still does not disable provider discovery or erase embeds. Iframe asset changes require a separate investigation because the iframe has its own enqueue path.

Disable one provider without disabling every embed

Use the documented wp_oembed_remove_provider() API when you want to block one provider while leaving the rest of the whitelist intact. The function expects the provider URL pattern and the handler that the site registered. Those values vary by provider and by the registration supplied by your site’s WordPress version or plugins, so confirm the exact entry before removing it.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

1. Find the registered provider entry

Identify the provider URL pattern WordPress matches and the handler associated with it. Do not guess from the public service URL: a registration can use a pattern, a regular expression, or a provider-specific endpoint. A plugin may also register an entry after core has loaded.

2. Add the removal in a site plugin or child theme

Put the change in a small site-specific plugin when possible. A child theme’s functions.php also works, but the behavior then depends on that theme remaining active. Run the removal after provider registrations are available, commonly on init:

add_action( 'init', function () {
    wp_oembed_remove_provider(
        $provider_url_pattern,
        $provider_handler
    );
} );

Replace the two variables with the exact pattern and handler from the registration you confirmed. The code above is a template, not a provider-specific pair of values.

Rank #2
EVEO® Screen Cleaner Spray Kit (Streak-Free) TV Screen Cleaner for Smart TV, Lcd, LEd, Oled | Computer Screen Cleaner Spray and Wipe Microfiber Cloth - TV, Monitor, Laptop, iPad, Car - 6.7oz 1 Pack
  • Screen Cleaner is Your Screen’s New Bestfriend! - EVEO is proud to present a screen cleaner that’s perfectly suited for your TV. Meet your new screen cleaner, computer screen cleaner, laptop cleaner, iPad cleaner, Macbook,tv cleaner or any other electronic device. Our screen cleaner spray and wipe along with the included plush microfiber cloth, easily removes dust, fingerprints & other smudges on the screen’s surface. Clean effectively for a streak-free screen
  • Gentle on your Screens - Our screen cleaner spray and wipes is compatible to be used even for the most sensitive LCD, LED, CRT, and OLED screens in proper use. Be at ease knowing that this product is compatible with all the major brands: LG, SONY, Samsung, Sharp, iPad, iPhone, Android screens, Kindle, PC monitors - we’ve got you covered! Can be used as LCD screen cleaner, tv cleaner, smart tv screen cleaner, and more
  • Premium Super Soft Plush Microfiber Cloth - Included in this efficient screen cleaning kit. This screen cleaner spray and wipe has our signature plush microfiber cloth specially designed to comply with screens and monitors and leave them streak-free. Has been shown to effectively absorbs stubborn stains, zero streaks, and no fiber shedding. Always use this together with our screen cleaner for the best results
  • Easy-to-Use Screen Cleaner Kit + microfiber cleaning cloth - The EVEO Screen Cleaning Kit will easily be your new favorite tool when it comes to taking care of the things you love most, quick and easy solution for a streak-free screen. Simply screw on the sprayer gun on the screen cleaner bottle. Spray the cleaning liquid onto the microfiber cloth, then wipe the screen until desired cleanliness & shine is achieved.
  • Quality Screen Care Kit Worth Purchasing - Enjoy a convenient Screen Cleaner anytime, anywhere you need it. Your satisfaction is our top priority. We stand behind the quality of our products and that’s why, you shouldn’t be worrying at all. We manufacture the Best Screen Cleaner. and can be used for laptop cleaning kit, laptop screen cleaner, tv screen cleaner for smart tv. MacBook screen cleaner, monitor cleaner or screen cleaner spray for electronic devices with microfiber cleaning cloth

3. Check the intended boundary

Provider removal affects the matching registration. It does not automatically block every iframe from that company if a plugin prints its own markup, and it does not remove an iframe that was already saved in a post. If another provider should continue to work, test it explicitly after the change.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

4. Clear caches and test new generation

Clear page, object and CDN caches, then create or edit a test post so WordPress has to process the URL again. Inspect the rendered result and page source. A previously saved block may continue to display because the HTML is already in post content; that is a content-cleanup task, not evidence that the provider removal failed.

Suppress the WordPress host script

WordPress historically used wp_oembed_add_host_js() to add JavaScript on the host page for communication with post-embed iframes. WordPress Developer Resources marks this function as deprecated since 5.9.0. It remains present for backward compatibility, and the documented legacy unhooking pattern still works.

Use the documented unhook

Add the removal after WordPress has registered its default callback, commonly during init:

add_action( 'init', function () {
    remove_action( 'wp_head', 'wp_oembed_add_host_js' );
} );

remove_action() must receive the same hook, callback and priority used when the callback was registered. If a site or plugin registered the callback at a non-default priority, pass that same priority as the third argument. Calling the removal too early, or with a different priority, leaves the callback attached.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
BladeHawks RGB Gaming Mouse Pad Extra Large Extended 31.5x12 Inch-Black
  • 【Large size】:Measuring 800 x 300 mm/ 31. 5×12 inches, which is wider and taller than others. Large mouse pad can perfectly fit your keyboard and mouse of any size, and there is also ample space for peripherals such as phones, tablets, etc.
  • 【LED backlight mouse pad】:Blade Hawks RGB mouse pad provides 7 static modes and 7 dynamic modes will give you the options you are looking for. Power-off memory function remembers the last lighting mode you selected. The super glow fiber Chroma will give you a colorful gaming setup that you want.
  • 【Anti-slip rubber base】:Made from Natural rubber, this gaming mousepad will firmly grip your desktop, allowing you to enjoy the ultimate precision in the games you are most passionate about. It also comes with a texture that enhances this ability even further.
  • 【Smooth and waterproof surface】: Micro-textured cloth surface, for extremely precise mouse control and a smooth movement. When liquid splashes on the gaming mouse pad, it forms water droplets and slides down. Will not delay your work or gameplay.
  • 【Plug and play】: This mouse and keyboard pad is powered by USB, plug and play, no driver required. One button control light modes. Press one time to change the lighting mode, press twice to change the brightness, press and hold about 3 seconds turn ON/OFF.

Understand what this does

This targets the host-script path. It does not remove a provider from the oEmbed whitelist, delete an iframe from post content, dequeue every script inside that iframe, or stop a plugin from printing its own JavaScript. If your objective is “do not accept URLs from one service,” remove that provider instead. If your objective is “do not add the host communication script,” use the unhook.

Account for the deprecation

Because the callback is deprecated, treat this as a compatibility control rather than a new integration point. Keep the code isolated and documented so it can be revisited if a future WordPress release changes the compatibility path. Do not call the deprecated function directly; the purpose of the code is to remove the callback when it is present.

Why removing the script may appear to do nothing

Since the WordPress 5.9-era core change, WordPress no longer loads wp-embed unconditionally. The function reference for wp_maybe_enqueue_oembed_host_js() describes a check for post-embed markup, including the wp-embedded-content class, before enqueueing the script. Trac changeset 52132, recorded on 2021-11-11, documents this move to conditional loading.

The practical result is important:

  • A page without a WordPress post embed may already have no wp-embed request.
  • Removing the legacy callback can produce no visible difference on that page.
  • A page containing a qualifying post embed is the meaningful test because it exercises the conditional branch.
  • An iframe generated by a plugin, a custom block or hand-written HTML may not use the same core path.

Conditional loading reduces unnecessary requests, but it also means a source comparison must use equivalent pages. Compare one post that contains a real WordPress post embed before and after the change, then compare a post without an embed to confirm that unrelated pages remain unaffected.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Iframe assets are a separate layer

The host page and the embed iframe do not share one asset queue. The enqueue_embed_scripts hook runs when scripts and styles for the embed iframe are queued. WordPress’s default iframe stylesheet is handled by wp_enqueue_embed_styles(). Removing the host callback does not automatically remove that stylesheet, other iframe assets, or a custom embed template.

Rank #4
Sale
Vaydeer Wrist Rest for Keyboard and Mouse, Computer Ergonomic Wrist Support Pad, Soft Memory Foam Arm Cushion for Desk, Palm Hand Office Laptop Typing
  • 【Softer and More Comfortable】Vaydeer wrist rest has unique diamond pattern, which is the combination of softness and aesthetics. The materials of wrist rest are improved into higher quality memory foam and covered with silky smooth lycra. The computer wrist rest makes you as comfortable and cushiony as like rest your wrists on clouds.
  • 【Ergonomic Wrist Saver】The wrist rests for keyboard and mouse comes with a 17.32×3.15×0.83 inch keyboard wrist pad and a 5.94×3.15×0.83 inch mouse wrist support. Based on ergonomic design, the unique concave shape is the perfect fit for your wrist joints. The wrist rest pad fits most computer keyboards and laptops, improve hand and wrist posture, release your wrist and arm stress.
  • 【Non-Slip Rubber Bottom】Featuring an anti-skid silicone base on the bottom, this wrist keyboard support stays firmly in place on your desk, preventing the padding from sliding around, ensuring stable and consistent wrist support during extended computer sessions.
  • 【Better Experience & Pain Relief】Our keyboard arm rest is beneficial to alleviate the soreness caused by direct contact and friction between your arm and a hard desk surface, reducing the risk of wrist fatigue or carpal tunnel. The soft texture of memory foam can evenly distribute the pressure around your wrists and provide good support with just enough give.
  • 【Helpful in Multiple Scenarios】Whether you're working, studying, writing, typing, gaming, this keyboard and mouse rest combo is an essential accessory to add comfort and support to your hands and wrists. It’s also a great gift for men, women, family, friend, coworker, gamer, teacher, etc.

Decide which side you are changing

  • Host page: inspect the wp-embed request and the callback attached to wp_head.
  • Iframe document: inspect callbacks on enqueue_embed_scripts, the stylesheet enqueued by wp_enqueue_embed_styles(), and any plugin-specific additions.
  • Custom template: inspect the template or rendering code that outputs the iframe. A template can bypass the core path entirely.

Only remove a specific iframe callback after confirming how it was registered. A broad dequeue can break the layout or behavior of every embed iframe, while a provider removal would not touch those assets at all.

Saved markup versus generated behavior

Hook changes influence generation and enqueueing; they do not rewrite old post content. Posts may contain an iframe, a block’s serialized HTML, or markup copied from an earlier render. That content can continue to appear even after you remove a provider or host callback.

Review representative posts

  1. Choose a post with the target provider, a post with another allowed provider, and a post with no embed.
  2. Open the editor and inspect the block or HTML source rather than relying only on the visual preview.
  3. Check whether the iframe or provider markup is stored directly in the post.
  4. Decide whether to edit those posts manually, run a controlled content migration, or leave historical embeds intact.

Do not delete stored markup merely to make a network request disappear. First establish whether the requirement concerns future oEmbed generation, host-page JavaScript, iframe assets, or the content itself.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Verification checklist

Use a real embed page and a control page. Perform the checks in this order so caching and conditional loading do not obscure the result:

  1. Flush caches. Clear page, object and CDN caches before each comparison. A cached HTML response can preserve an old script tag after the PHP change is correct.
  2. Test a post containing a WordPress post embed. An empty page is not a valid test for conditional wp-embed loading.
  3. View page source. Search for wp-embed, the wp-embedded-content class and the provider URL.
  4. Inspect browser network requests. Confirm whether the host script and the embed iframe are requested, and record which document initiated each request.
  5. Test a post without an embed. This establishes the baseline for pages where core should not enqueue the conditional script.
  6. Test an allowed provider. When blocking one provider, verify that another registered provider still generates an embed.
  7. Inspect plugin and theme code. Search for custom enqueue calls, iframe markup and template overrides that may be independent of core.
  8. Repeat after a logged-out check. Caching, optimization plugins or editor-only behavior can make an authenticated view differ from the public page.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshoot common outcomes

The wp-embed request is still present

First confirm that the page really contains post-embed markup. If it does, check that the unhook runs after registration and that its priority matches the registration. Then inspect plugins and the active theme for another enqueue path. Finally, purge every cache layer and recheck page source rather than relying on a browser’s cached network panel.

Best Value
Sale
Under Desk Cable Management Tray No Drill, Metal Mesh Cable Management Under Desk with Clamp Mount, 2 Hole Cable Tray with Wire Management and Cord Organizer for Home Office Standing Desk
  • 【No Drill Mounted】Cable management tray can be assembled in as little as 3 minutes or less-simply. Side clips easily clampe the edge of desk, pass through the holes on the sides, and secure excess cables with baskets. Desk cable management supports inward or outward installation to meet your needs in different scenarios, and provides you with great convenience when collecting and organizing wires.
  • 【Rubber Pad Protects Desk】Wire organizer under desk built-in soft rubber pads on the clamp protect your desk from scratches, so you will not damage your furniture or office.
  • 【Sturdy and Beautiful】Cord management under desk is made of high-quality carbon steel and holds about 15 lbs. The wire basket has 2 holes on each side of the tray to enable your cables to pass freely. Cable baskets are suitable for desk thickness use from 0.4" to 2.4".
  • 【Space Saving & Keep Organized】Desk cable management tray holds all your power cords, outlet strips, USB hubs and computer transformers hidden from your feet, and the data cables will not enter the vacuum cleaner to keep your desk clean and tidy. Desk wire organizer is also suitable for use in the kitchen and outdoors.
  • 【Reduce Safety Risks】Cable tray under desk keeps all plugs away from your kids, no more worry about tripping. Using 2 holes wire tray saves extra space, helps you easily cabling and wire protection. The mesh design is not easy to accumulate dust, but avoids safety accidents caused by messy wires.

The iframe still loads after removing the host callback

That is expected when the iframe HTML is already saved in post content or is generated by a provider, block, plugin or custom template. Host-script removal does not remove iframe markup. Use provider removal for future oEmbed recognition, edit stored content for historical embeds, or inspect the iframe’s own enqueue and rendering layer.

Removing one provider broke more than intended

Recheck the URL pattern and handler against the actual registration. An overly broad pattern can match URLs beyond the service you meant to block. Narrow the pattern, restore the previous code, clear caches and test both the targeted provider and an allowed provider.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The iframe stylesheet remains

The stylesheet belongs to the iframe asset path, not the host callback. Inspect enqueue_embed_scripts and the registration performed by wp_enqueue_embed_styles(). Change only the confirmed callback or asset, and test the iframe document itself.

Nothing changes after deployment

Check that the site plugin or child theme is active, that PHP loaded without an error, and that the code runs on the request type you are testing. Verify the callback with source and network inspection, not only with the editor preview. A page without a qualifying post embed can legitimately look identical before and after the change.

Safe rollout and reversal

Make one change at a time and keep provider removal separate from host-script and iframe-asset changes. Record the exact provider pattern, handler, hook and priority you changed. This makes reversal straightforward: restore the removed provider registration or remove the unhooking code, clear caches and rerun the same test matrix.

Deploy first to a staging copy when the site has many embedded posts or relies on plugin-generated iframes. Check responsive behavior, editor previews and public cached pages. If only one service is unwanted, do not combine a provider removal with a global host-script change; the narrower change gives you a clearer failure boundary and preserves unrelated embeds.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Key distinctions to remember

  • oEmbed is a provider protocol backed by WordPress’s whitelist, not a single on/off setting.
  • wp_oembed_remove_provider() targets a registered provider entry; it is the appropriate control for one service.
  • wp_oembed_add_host_js() is deprecated as of WordPress 5.9.0, but compatibility unhooking remains supported.
  • wp-embed is conditionally loaded when post-embed markup is detected, so test a page that actually contains one.
  • The enqueue_embed_scripts hook and wp_enqueue_embed_styles() govern iframe-side assets separately from host-page JavaScript.
  • Hooks affect future generation and enqueueing; saved iframe or block markup requires a separate content review.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.