Title: IMDB ID Value
Last modified: September 1, 2016

---

# IMDB ID Value

 *  Resolved [Matt Blank](https://wordpress.org/support/users/mattblank/)
 * (@mattblank)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/imdb-id-value/)
 * I used to use this and was able to wrap the movie_imdb_id in a URL, so this would
   have exported a hyperlink to IMDB:
 * [http://www.imdb.com/title/&lt](http://www.imdb.com/title/&lt);?php echo do_shortcode(‘[
   movie_imdb_id]’);?>
 * However it’s recently changed so that shortcode produces various other code within
   it. How else can I now therefore just grab the raw IMDB value?
 * Thanks!
    Matt
 * [https://wordpress.org/plugins/wpmovielibrary/](https://wordpress.org/plugins/wpmovielibrary/)

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

 *  Plugin Author [Charlie Merland](https://wordpress.org/support/users/caercam/)
 * (@caercam)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/imdb-id-value/#post-7643114)
 * Hi Matt,
 * Don’t bother with Shortcodes, especially if you’re just generating an URL. Movie
   metadata are regular posts meta, so this simple piece of code will do the job:
 *     ```
       $imdb_id = get_post_meta( get_the_ID(), '_wpmoly_movie_imdb_id', $single = true );
       $url = esc_url( 'http://www.imdb.com/title/' . $imdb_id );
       ```
   
 * If you want to extend this to every occurrence of an IMDb ID, try using [this code](https://gist.github.com/CaerCam/efc7c6ccb8b4680c98611bc79def6893)
   instead 🙂
 *  Thread Starter [Matt Blank](https://wordpress.org/support/users/mattblank/)
 * (@mattblank)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/imdb-id-value/#post-7643119)
 * Thanks, but I don’t follow? I’ve pasted that in (with <? and ?>) around it, but
   nothing seems be be outputted?
 *  Plugin Author [Charlie Merland](https://wordpress.org/support/users/caercam/)
 * (@caercam)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/imdb-id-value/#post-7643126)
 * Ah, sorry about that, should have mentioned you need a `echo` somewhere for this
   to be displayed. Replace your initial
 * `http://www.imdb.com/title/<?php echo do_shortcode('[movie_imdb_id]');?>`
 * With
 * `<?php echo esc_url( 'http://www.imdb.com/title/' . get_post_meta( get_the_ID(),'
   _wpmoly_movie_imdb_id', true ) ); ?>`
 * And you should be good to go!
 *  Thread Starter [Matt Blank](https://wordpress.org/support/users/mattblank/)
 * (@mattblank)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/imdb-id-value/#post-7643129)
 * Great!! Thank you SO much 🙂
 *  Plugin Author [Charlie Merland](https://wordpress.org/support/users/caercam/)
 * (@caercam)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/imdb-id-value/#post-7643131)
 * You’re welcome!

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

The topic ‘IMDB ID Value’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wpmovielibrary_f6ad77.svg)
 * [WPMovieLibrary](https://wordpress.org/plugins/wpmovielibrary/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wpmovielibrary/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wpmovielibrary/)
 * [Active Topics](https://wordpress.org/support/plugin/wpmovielibrary/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wpmovielibrary/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wpmovielibrary/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [Charlie Merland](https://wordpress.org/support/users/caercam/)
 * Last activity: [9 years, 9 months ago](https://wordpress.org/support/topic/imdb-id-value/#post-7643131)
 * Status: resolved