Title: oEmbed Filter?
Last modified: August 19, 2016

---

# oEmbed Filter?

 *  Resolved [ianatkins](https://wordpress.org/support/users/ianatkins/)
 * (@ianatkins)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/oembed-filter/)
 * When getting some content with the get_page function I can’t make an oEmbed video
   work. The template just returns the flat link to the file.
 * Here is my code, I’ve tried apply the the_content filter but its not working.
 * Any ideas / help!
 * Thanks
 * Ian.
 *     ```
       // load videos
       	$page_id = 724;
       	$page_data = get_page( $page_id );
       	$videos = $page_data->post_content; // Get Content
       	$videos = apply_filters('the_content', $videos);
       	echo $videos;
       ```
   

Viewing 8 replies - 1 through 8 (of 8 total)

 *  Moderator [James Huff](https://wordpress.org/support/users/macmanx/)
 * (@macmanx)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/oembed-filter/#post-1538961)
 * Are you attempting to embed from one of the “approved” sites?
 * [http://codex.wordpress.org/Embeds#Okay.2C_So_What_Sites_Can_I_Embed_From.3F](http://codex.wordpress.org/Embeds#Okay.2C_So_What_Sites_Can_I_Embed_From.3F)
 *  Thread Starter [ianatkins](https://wordpress.org/support/users/ianatkins/)
 * (@ianatkins)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/oembed-filter/#post-1539052)
 * Yep, its youtube. it just doesn’t get processed.
 * If I post the url in a normal page it processes fine. Its just accessing the 
   data via get_page that doesn’t work.
 *  [Laurent LaSalle](https://wordpress.org/support/users/laurentlasalle/)
 * (@laurentlasalle)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/oembed-filter/#post-1539283)
 * Similar problem here. What the hell?!
 *  Thread Starter [ianatkins](https://wordpress.org/support/users/ianatkins/)
 * (@ianatkins)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/oembed-filter/#post-1539293)
 * Yeah I didn’t find a solution.
 * bump.
 *  Anonymous User 7341632
 * (@anonymized-7341632)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/oembed-filter/#post-1539298)
 * Same issue, but it only appears in a category archive. It’s not caused by a conflict
   since I get the non-embedded url even if this is the only thing I include in 
   the page:
 *     ```
       <?php
       $player = get_page($pageid = 93);
       echo apply_filters('the_content', $player->post_content);
       ?>
       ```
   
 *  [dan.imbrogno](https://wordpress.org/support/users/danimbrogno/)
 * (@danimbrogno)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/oembed-filter/#post-1539299)
 * One thing I’d recommend trying is wrapping your content in stripslashes(), or
   maybe increase the number that the filter gets applied, i.e.
 * `apply_filters('the_content', $videos, 99);`
 * Just blind guesses. Seeing a var_dump of your $videos variable may help though.
 *  Anonymous User 7341632
 * (@anonymized-7341632)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/oembed-filter/#post-1539300)
 * I solved by just using a simple `query_posts`
 *     ```
       <?php 	query_posts(array('page_id'=>93));
       if(have_posts()) : the_post(); ?>
       <aside>
       <h2><?php the_title(); ?></h2>
       <?php the_content(); ?>
       </aside>
       <?php
       wp_reset_query();
       endif;?>
       ```
   
 * I was using this method earlier and I switched to `get_page` for (unproven) speed’s
   sake, but apparently it doesn’t work as well as `query_posts`. You could also
   use a WP_query object, but I’m not familiar with it.
 *  Thread Starter [ianatkins](https://wordpress.org/support/users/ianatkins/)
 * (@ianatkins)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/oembed-filter/#post-1539329)
 * Just for anyone else looking.
 * I ended up storing the URL as a custom field then using wp_oembed_get
 * [http://codex.wordpress.org/Function_Reference/wp_oembed_get](http://codex.wordpress.org/Function_Reference/wp_oembed_get)

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘oEmbed Filter?’ is closed to new replies.

## Tags

 * [filter](https://wordpress.org/support/topic-tag/filter/)
 * [oEmbed](https://wordpress.org/support/topic-tag/oembed/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 8 replies
 * 5 participants
 * Last reply from: [ianatkins](https://wordpress.org/support/users/ianatkins/)
 * Last activity: [15 years, 1 month ago](https://wordpress.org/support/topic/oembed-filter/#post-1539329)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
