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 get serialized post meta

get_post_meta() with the 3rd parameter set to true will return a single item with the key specified in the 2nd parameter (_custom_field in your code). If this item is an array, it’ll return as the array. In your case, it appears that the data is:

array(
    'video_url' => '',
)

…which is why, when you try to echo it, it’s printing Array to the screen.

I’d suggest something more like this:

<?php
$meta = get_post_meta(get_the_ID(), '_custom_field', TRUE);
echo $meta['video_url'];
?>

…or, if you’re expecting multiple video_urls, you could do this:

<?php
$meta = get_post_meta(get_the_ID(), '_custom_field');
foreach ( $meta as $item ) {
    echo $item['video_url'];
}
?>

(Note that it also appears that, in the metadata you’ve posted, there’s an empty value for the actual video_url, but I can’t say what might have caused that.)

Related Posts:

  1. How to update custom fields using the wp_insert_post() function?
  2. How to display multiple Post meta_key/meta_values by SQL query
  3. How to use multiple query with same meta key
  4. How can update custom meta for all posts
  5. Use ajax to update_post_meta
  6. how to increase custom post value by one most efficiently?
  7. How can I create a list of page titles from custom meta values?
  8. Store multiple custom field as post meta per post(css, js, html, 2 link) [closed]
  9. How to VAR_DUMP a $variable during checkout process (Is my product meta callable?)
  10. Is it possible to retrieve all posts with a certain value for metadata?
  11. Non-Closing PHP Query in WordPress Loop
  12. Querying Database with wpdb
  13. WordPress loop by meta key that is an array? and how loop multiple arrays
  14. How to store multiple custom meta box
  15. Order a WP_Query by meta value where the value is an array
  16. Add a custom class to the body tag using custom fields
  17. Define category ID using get_post_meta
  18. Hide a div when a custom field is empty
  19. WordPress stripping out custom field tags
  20. Order category posts by last word of custom field
  21. Add a “custom field” to a category that can be retrieved when viewing the category page with get_post_meta
  22. How to update custom fields when post is published?
  23. What is the correct way to search 3 custom fields only in WordPress?
  24. WP post meta – for loop inside for loop
  25. When working with a post, almost all wp_postmeta are deleted
  26. Updating Lat and Lng of posts automatically gives sporadic results
  27. Order by in foreach
  28. If custom field doesn’t exist, or exists and it’s true show title?
  29. Metadata on the WP_Post object
  30. $wpdb->update with multiple parameters gives error
  31. Assign / update custom field value for all posts (How can I assign only to posts without custom field value?)
  32. wordpress allow user to edit user profile with custom fields
  33. Why do WP_Query results change after updating unrelated Advanced Custom Fields (ACF)?
  34. How to display data from custom table in wordpress phpmyadmin
  35. Sort custom meta column by other meta value
  36. Querying wpdb using PHP
  37. Creating user status mode in WordPress
  38. Need Help Fixing My Iframes [closed]
  39. get_post_meta not working on publishing
  40. Need help with Google drive API [closed]
  41. Firing schema via code in functions.php doesn’t work
  42. Adding number to date not working [closed]
  43. Is it possible to create a wordpress database with php code?
  44. Update results, Before deleting the related category [closed]
  45. How can I add extra word in permalink when someone click download button?
  46. Saving and Restoring a Canvas on A Individual User Basis
  47. Seach custom post type posts only by meta fields?
  48. How WordPress reacts to a lack of memory of the server [closed]
  49. wpdb php get_var query to get ID for URL image doesn’t work for ID over 999
  50. How to use thumbnail size of image if I’m only using src to get image
  51. 3 Slashes appear after Apostrophe in custom fields after updating product-site
  52. how to retrieve a value if a checkbox is checked
  53. wp query foreach deleting record returning only first or last item
  54. Trouble checking if custom woocommerce checkout field is empty or not
  55. Two queries for a WP_User_Query search work perfectly apart, but not together
  56. Archive post by meta value + 24hours
  57. auto-populating custom nav with all items from custom post type
  58. Database query works fine outside WordPress
  59. Using $wpdb (WPDB class) ‘replace’ with multiple WHERE criteria problem
  60. Add / Update Custom Fields After Select Pictures in Media Window
  61. WordPress update_post_meta updating with empty meta_value field [closed]
  62. conditional logic for front-end custom field edits
  63. $wpdb->insert() does not Insert record in a table
  64. Trying to retrieve post meta
  65. Automatic Shortcode Creation with Custom Fields [closed]
  66. Custom field values to taxonomy terms
  67. Help with a $wpdb MySQL Query
  68. How would an if statement surrounding a custom field with two variables (holding values) look like?
  69. Trouble Installing WordPress Get PHP Not Running Answer
  70. How to add specific meta tags to head of cart and checkout pages in woocommerce?
  71. Custom Field IF/ELSE PHP
  72. Fatal error: Call to a member function query() on a non-object
  73. Which PHP page is the Default Posts Page
  74. How to combine 2 php functions into one function with a custom field
  75. Remove the last X characters of a custom field value
  76. Advanced Custom Fields – display label and value only if value entered
  77. Get post id within comments loop
  78. Saving zero in meta box
  79. Update a buggy installation
  80. Custom array from a query only write the last row of the query
  81. Find a way to retrive data updated through metabox plugin to web page
  82. Why are the details of my todo not saving?
  83. How to check if a PHP string is different than meta field?
  84. Can’t save php string to a custom field
  85. Error using WordPress $wpdb object to get result from custom table
  86. Display custom field on 404 page outside loop
  87. How to retrieve the data from the sever and displaying it in a page?
  88. Why does this update_post_meta function not delete the custom field itself?
  89. How to show/hide php table rows based on the content of custom fields
  90. Run str_replace on title and save the output to a custom field
  91. $wpdb returns duplicate posts
  92. Can’t update multiple rows with $wpdb query
  93. Mixing variables into an array when inserting values
  94. update_post_meta only updating on last loop of foreach
  95. Only show image from custom field when present
  96. Wpdb->insert() doesn’t insert new row after the last one
  97. Hide Heading if ACF Field is empty
  98. Custom meta box values are not getting saved for my custom post type
  99. How to use two meta_compare in an array?
  100. Show ACF field with link to ultimate member profile/WordPress user profile below the post (single post layout)
Categories PHP Tags custom-field, php, phpmyadmin, post-meta, wpdb
Custom Post Types not queried in Custom Taxonomy archives or Native archives
ACF: If field contain a specific value, update value in another field programatically

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