Title: oembed_dataparse
Published: April 25, 2014
Last modified: February 24, 2026

---

# apply_filters( ‘oembed_dataparse’, string|false $return, object $data, string $url )

## In this article

 * [Description](https://developer.wordpress.org/reference/hooks/oembed_dataparse/?output_format=md#description)
 * [Parameters](https://developer.wordpress.org/reference/hooks/oembed_dataparse/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/hooks/oembed_dataparse/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/hooks/oembed_dataparse/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/hooks/oembed_dataparse/?output_format=md#changelog)
 * [User Contributed Notes](https://developer.wordpress.org/reference/hooks/oembed_dataparse/?output_format=md#user-contributed-notes)

[ Back to top](https://developer.wordpress.org/reference/hooks/oembed_dataparse/?output_format=md#wp--skip-link--target)

Filters the returned oEmbed HTML.

## 󠀁[Description](https://developer.wordpress.org/reference/hooks/oembed_dataparse/?output_format=md#description)󠁿

Use this filter to add support for custom data types, or to filter the result.

## 󠀁[Parameters](https://developer.wordpress.org/reference/hooks/oembed_dataparse/?output_format=md#parameters)󠁿

 `$return`string|false

The returned oEmbed HTML, or false on failure.

`$data`object

A data object result from an oEmbed provider.

`$url`string

The URL of the content to be embedded.

## 󠀁[Source](https://developer.wordpress.org/reference/hooks/oembed_dataparse/?output_format=md#source)󠁿

    ```php
    return apply_filters( 'oembed_dataparse', $return, $data, $url );
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-oembed.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/class-wp-oembed.php#L746)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/class-wp-oembed.php#L746-L746)

## 󠀁[Related](https://developer.wordpress.org/reference/hooks/oembed_dataparse/?output_format=md#related)󠁿

| Used by | Description | 
| [WP_oEmbed::data2html()](https://developer.wordpress.org/reference/classes/wp_oembed/data2html/)`wp-includes/class-wp-oembed.php` |

Converts a data object from [WP_oEmbed::fetch()](https://developer.wordpress.org/reference/classes/wp_oembed/fetch/) and returns the HTML.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/hooks/oembed_dataparse/?output_format=md#changelog)󠁿

| Version | Description | 
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Introduced. |

## 󠀁[User Contributed Notes](https://developer.wordpress.org/reference/hooks/oembed_dataparse/?output_format=md#user-contributed-notes)󠁿

 1.  [Skip to note 2 content](https://developer.wordpress.org/reference/hooks/oembed_dataparse/?output_format=md#comment-content-3233)
 2.   [Maya Soloveva](https://profiles.wordpress.org/mayasol/)  [  7 years ago  ](https://developer.wordpress.org/reference/hooks/oembed_dataparse/#comment-3233)
 3. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Foembed_dataparse%2F%23comment-3233)
    Vote results for this note: 2[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Foembed_dataparse%2F%23comment-3233)
 4. Can be used to wrap oEmbed response in html, depending on type and size of oEmbed.
 5.     ```php
        function wrap_oembed_dataparse($return, $data, $url) {
    
        	$mod = '';
    
        	if  (   ( $data->type == 'video' ) &&
        			( isset($data->width) ) && ( isset($data->height) ) &&
        			( round($data->height/$data->width, 2) == round( 3/4, 2) )
        		)
        	{
        		$mod = 'embed-responsive--4-3';
        	}
    
        	return '<div class="embed-responsive ' . $mod . '">' . $return . '</div>';
        }
    
        add_filter( 'oembed_dataparse', 'wrap_oembed_dataparse', 99, 4 );
        ```
    
 6. To use ‘oembed_dataparse’ for the first time, you might have to clear oEmbed post-
    meta cache:
 7.     ```php
        add_filter( 'oembed_ttl', function($ttl) {
        	  $GLOBALS['wp_embed']->usecache = 0;
                    $ttl = 0;
                    // House-cleanoing
                    do_action( 'wpse_do_cleanup' );
        	return $ttl;
        });
    
        add_filter( 'embed_oembed_discover', function( $discover )
        {
            if( 1 === did_action( 'wpse_do_cleanup' ) )
                $GLOBALS['wp_embed']->usecache = 1;
            return $discover;
        } );
        ```
    
 8.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Foembed_dataparse%2F%3Freplytocom%3D3233%23feedback-editor-3233)

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Foembed_dataparse%2F)
before being able to contribute a note or feedback.