Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

How to set YouTube video as featured image?

Well this is not exactly a WordPress problem / solution.

First you have to either get the video id from the video_site_url post meta or save the YouTube video id in it’s own post meta field, maybe youtube_video_id.

Next you can get the thumbnail using one of these url

http://img.youtube.com/vi/<insert-youtube-video-id-here>/0.jpg
http://img.youtube.com/vi/<insert-youtube-video-id-here>/1.jpg
http://img.youtube.com/vi/<insert-youtube-video-id-here>/2.jpg
http://img.youtube.com/vi/<insert-youtube-video-id-here>/3.jpg

Read this SO answer

Related Posts:

  1. Do_Shortcode not working for Embed
  2. How to add multiple featured image in meta box in post editor?
  3. Query all posts where a meta key does not exist
  4. How come Featured Image isn’t showing up in my Custom Post Type?
  5. Can the Next/Prev Post links be ordered by menu order or by a meta key?
  6. what is the correct way to compare dates in a WP query_posts meta_query
  7. Advanced search form with filters for custom taxonomies and custom fields
  8. add_image_size() for specific Post Types
  9. Setting a post’s featured image from an embedded YouTube video
  10. Meta query with boolean true/false value
  11. How to disable generation of default image sizes for some custom post types?
  12. Get post with multiple meta keys and value
  13. Correctly delete posts with meta and attachments [duplicate]
  14. Using add_theme_support inside a plugin
  15. Custom user role cannot see or modify featured image
  16. Make featured image required
  17. Storing revisions of metadata for custom post type
  18. How to remove “featured image” functionality from a custom post type?
  19. Custom field values deleted when trashing custom post type
  20. How to get all custom fields of any post type
  21. Update CPT meta data using REST API
  22. Admin Area Custom Type Search By Meta Fields Without Title & Content
  23. Echo all meta keys of a custom-post TYPE
  24. Custom Post type – how to get checkbox to update meta field to null
  25. Featured Image Panel Missing From Custom Post Type in WordPress 3.2
  26. How can I filter posts by post_parent in the admin?
  27. How do I Paginate Search Results for Custom Post Types?
  28. Implementing “Video of the Day” Feature?
  29. set_post_thumbnail_size in percent, not pixels?
  30. Best way to filter featured image text for a custom post type?
  31. Ordering posts having multiple post-meta date fields
  32. Custom Post Type with Input fields to seperate table on database.
  33. How do I remove all the metaboxes for a custom post type?
  34. Custom Queries: Joining On Meta Values From Two Custom Post Types
  35. Gutenberg how to make attribute to save to meta
  36. How to programmatically create a connection with [Plugin: Posts 2 Posts] on cpt publish?
  37. Post metadata deletes itself
  38. How to create a mini directory in WordPress?
  39. How Can I save multiple records in same meta key?
  40. If featured image doesn’t exist, show post content
  41. Get all posts from custom post type and insert in select input as metabox
  42. Detect meta value changes when post is updated (post_updated)
  43. Search everything (posts, pages, tags, cpt, meta)
  44. Permalinks using event date (year & month) instead of publication date
  45. set and unset the custom field value
  46. Custom Post Type: Set post_title equal to a custom post type field
  47. I can’t set meta_key in my custom post type query
  48. Grossly inefficient wordpress loops!
  49. Compare 3 custom fields and sort by oldest
  50. How I upload, save and set a featured image from my frontend?
  51. How Do I Use WP_Query to Run This Database Query as Search Result?
  52. WordPress Admin Panel search posts with custom post meta values along with title
  53. Creating a custom post type upon registration
  54. How to Update post status using meta data in Custom post TYpe
  55. Rest Api v2 orderby meta_key in custom post type
  56. bulk Update post_meta with default values
  57. Reason action hook won’t work with update_post_meta from frontend form? Alternative?
  58. Trouble adding custom featured image for custom taxonomy TERMS
  59. Can’t sort order of wp_query with 2 meta keys
  60. Showing Meta Data for Custom Post Types?
  61. How to get source of custom meta image?
  62. Having trouble with custom post type / meta box
  63. Query for posts from any post type but only add instock products
  64. How can I include meta box content when searching?
  65. update a post meta from a single table cell TablePress
  66. update custom post type meta from a shortcode
  67. How can i place Feature Image under title field in wp-admin?
  68. Embed ‘New Post’ Form Inside ‘New Post’ Form
  69. Custom Meta Boxes – Nonce Issue – Move to trash issue
  70. How to remove thumbnail sizes for specific post type on a child theme?
  71. Featured image metabox not showing up
  72. image srcset returns false
  73. Displaying Meta Box Image
  74. Custom post type category not displaying in custom post type
  75. How to use different featured image size for a custom post type?
  76. get_the_post_thumbnail() returning empty string on custom post type
  77. Change admin post thumbnail size for custom post type only
  78. How to make custom post meta wp_editor translatable?
  79. Automatically adding meta data to posts or multiple query help
  80. How to keep a check box in custom meta box for custom post type checked by default for add new post?
  81. Show metabox in custom-post-template depending on taxonomy term?
  82. Should I use custom post types for a front page video feature (vimeo)?
  83. ACF Upload Image in repeater from front-end with custom form? – add_post_meta()
  84. update_post_meta() whenever custom post type is updated
  85. Formatting custom meta box date from YYYY/MM/DD to a more readable alternative
  86. Trigger “unsaved changes” dialog for custom post meta changes
  87. Using date stored as custom field to filter posts displayed in admin
  88. Conditionally Query Custom Post Types by Post Meta for Blog Home Page?
  89. Displaying custom posts only if custom meta box’s date is not expired
  90. Displaying Metabox value (custom post type taxonomy)
  91. How to List Thumbnails based on Custom Categories
  92. How do I sort a custom post type admin column using two meta keys?
  93. reference the current category being used in the category.php page
  94. Add Post Url to Manage Edit Screen
  95. add_image_size for post type
  96. Gutenberg Featured-Image-panel missing when user with custom role edits Custom Post Type
  97. How to best delete orphan wp_postmeta
  98. How can I display my custom metaboxes on a custom post template?
  99. Display all custom post type posts and order them by an optional meta_key
  100. Meta Box Only in CPT Edit Page, Not in Add New
Categories custom-post-types Tags custom-post-types, embed, post-meta, post-thumbnails, youtube
Does wordpress prevent non wordpress pages from being allowed on the same domain?
Custom post type templating problem

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress