# Disable lazy-loading iframe within post content in WordPress 5.7

**URL:** <https://community.mainwp.com/t/disable-lazy-loading-iframe-within-post-content-in-wordpress-5-7/2767>\
**Category:** Code Snippets\
**Tags:** wordpress\
**Created:** [February 19, 2021, 8:02pm UTC](https://community.mainwp.com/t/disable-lazy-loading-iframe-within-post-content-in-wordpress-5-7/2767 "2021-02-19T20:02:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sebastian-moran](https://community.mainwp.com/user_avatar/community.mainwp.com/sebastian-moran/32/16_2.png) [@sebastian-moran](https://community.mainwp.com/u/sebastian-moran)\
**Post date:** [February 19, 2021, 8:02pm UTC](https://community.mainwp.com/t/disable-lazy-loading-iframe-within-post-content-in-wordpress-5-7/2767/1 "2021-02-19T20:02:58Z")

</div>

Disable lazy-loading iframe within post content in WordPress 5.7 on your child site.

**Snippet Type**

`Execute on Child Sites`

**Snippet**

```auto
function disable_post_content_iframe_lazy_loading( $default, $tag_name, $context ) {
    if ( 'iframe' === $tag_name && 'the_content' === $context ) {
        return false;
    }
    return $default;
}
add_filter(
    'wp_lazy_loading_enabled',
    'disable_post_content_iframe_lazy_loading',
    10,
    3
);

```

---

<div class="post-metadata">

**Author:** ![system](https://community.mainwp.com/uploads/default/original/2X/4/4cfc87ac67e4ebdbfa0bbf0b19c8657f35a29a5b.png) [@system](https://community.mainwp.com/u/system)\
**Post date:** [March 21, 2021, 8:02pm UTC](https://community.mainwp.com/t/disable-lazy-loading-iframe-within-post-content-in-wordpress-5-7/2767/2 "2021-03-21T20:02:58Z")

</div>

Closed on March 21, 2021, 8:02pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
