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 do i get value from wp_postmeta?

Try this :

$value = get_post_custom_values( 'banda_postmeta', $post->ID );    
$value = unserialize("$value");
print_r($value);
echo $value['social_networks_url']['twitter_url']; 

Your social_networks_url are blank, so try echoing these values, it will echo the value.

echo $value['page_builder_settings']."<br />";
echo $value['date_of_birth']."<br />";
echo $value['location']."<br />";

Output :

array (size=7)
      'social_networks_url' => 
        array (size=9)
          'twitter_url' => string 'wr' (length=2)
          'facebook_url' => string '' (length=0)
          'youtube_url' => string '' (length=0)
          'google-plus_url' => string '' (length=0)
          'linkedin_url' => string '' (length=0)
          'instagram_url' => string '' (length=0)
          'dribbble_url' => string '' (length=0)
          'github_url' => string '' (length=0)
          'pinterest_url' => string '' (length=0)
      'page_builder_settings' => string 'global' (length=6)
      'date_of_birth' => string '1932-10-24' (length=10)
      'location' => string 'California <div class="rssfeeds"><img src="http://www.speakingofbusiness.com/wp-content/uploads/2014/12/logo-rss-feed.png" width="12" /><button onclick="myFunction()">RSS</button></div>' (length=185)
      'ad' => string '<a href="http://www.kqzyfj.com/click-5434584-10365698" target="_top"> <img src="http://www.tqlkg.com/image-5434584-10365698" width="120" height="60" alt="www.1and1.com" border="0"/></a>' (length=185)
      'ad1' => string 'Hi' (length=2)
      'ad2' => string 'Hello' (length=5)




    wr
    global
    1932-10-24
    California www.1and1.com
    Hi
    Hello

See my Code and output :

    $str="a:7:{s:19:"social_networks_url";a:9:{s:11:"twitter_url";s:2:"wr";s:12:"facebook_url";s:0:"";s:11:"youtube_url";s:0:"";s:15:"google-plus_url";s:0:"";s:12:"linkedin_url";s:0:"";s:13:"instagram_url";s:0:"";s:12:"dribbble_url";s:0:"";s:10:"github_url";s:0:"";s:13:"pinterest_url";s:0:"";}s:21:"page_builder_settings";s:6:"global";s:13:"date_of_birth";s:10:"1932-10-24";s:8:"location";s:185:"California <div class="rssfeeds"><img src="http://www.speakingofbusiness.com/wp-content/uploads/2014/12/logo-rss-feed.png" width="12" /><button onclick="myFunction()">RSS</button></div>";s:2:"ad";s:185:"<a href="http://www.kqzyfj.com/click-5434584-10365698" target="_top"> <img src="http://www.tqlkg.com/image-5434584-10365698" width="120" height="60" alt="www.1and1.com" border="0"/></a>";s:3:"ad1";s:2:"Hi";s:3:"ad2";s:5:"Hello";}";
    $value = unserialize($str);

    echo $value['social_networks_url']['twitter_url']."<br />";
    echo $value['page_builder_settings']."<br />";
    echo $value['date_of_birth']."<br />";
    echo $value['location']."<br />";
    echo $value['ad']."<br />";
    echo $value['ad1']."<br />";
    echo $value['ad2']."<br />";

Related Posts:

  1. Dealing with Many Meta Values, 30+
  2. Migrating non-WordPress CMS to WordPress, lots of data to move — possible solutions?
  3. How to solve slow WordPress site caused by attachment_metadata
  4. Delete all post meta except featured image
  5. Delete all post meta except featured image Using SQL
  6. WordPress and MySQL: how to transfer Meta_key and Meta_Value from one post_id to another
  7. Saving zero as meta value
  8. “BS_” rows in postmeta table
  9. SQL query : Select a thumbnail for a media
  10. Rename a table in MySQL
  11. How should I tackle –secure-file-priv in MySQL?
  12. Can’t connect to MySQL server on ‘127.0.0.1’ (10061) (2003)
  13. Can’t connect to MySQL server on ‘127.0.0.1’ (10061) (2003)
  14. Can’t connect to MySQL server on ‘127.0.0.1’ (10061) (2003)
  15. MySQL SELECT increment counter
  16. phpMyAdmin – Error > Incorrect format parameter?
  17. Failed to connect to mysql at 127.0.0.1:3306 with user root access denied for user ‘root’@’localhost'(using password:YES)
  18. Using wpdb to connect to a separate database
  19. MySQL Database User: Which Privileges are needed?
  20. Why is my database import losing text widget data?
  21. Will it break my site if I delete all transient records in wp_options table?
  22. Checking if Database Table exists
  23. Why WordPress choose data serialization over json_encode?
  24. WordPress (MyISAM) database is slow, should I switch to InnoDB?
  25. Please explain how WordPress works with MySQL character set and collation at a low level
  26. The MySQL alternatives: Do Percona Server and MariaDB work well with WordPress, and do they make WordPress go better?
  27. How to fetch Data in WordPress using MySQLi or $wpdb
  28. WordPress Database lost auto increment
  29. Connect to database using wordpress wp-config file
  30. wpdb->insert multiple record at once
  31. Reset Post IDs to less than 64bit integer
  32. How To Export/Import WordPress (MySQL) Database Properly Via Command-Line?
  33. Restoring WordPress posts from database only
  34. WordPress database scalability from the code perspective
  35. How to define composite keys with dbDelta()
  36. Is it possible to define two databases for one installation?
  37. Does WordPress use the InnoDB engine for MySQL by default?
  38. Slow wp_term_relationships query
  39. How to use “TRUNCATE TABLE” MySQL statement?
  40. Can I use MariaDB instead of MySQL in wordpress?
  41. What is the most secure way to store post meta data in WP?
  42. Using Dynamic Data Pulled from a MySQL Table in a WordPress Page
  43. How to delete outdated, wrongly sized images in _wp_attachment_metadata?
  44. WordPress for a very large website
  45. What are conventions about the schema of the $table_prefix
  46. Split WP install between 2 databases?
  47. Meta query interfering with orderby relevance
  48. Inserting Post Meta From SQL
  49. WooCommerce with thousands of products – site is very slow – optimize db queries? [closed]
  50. importing data from non-wordpress mysql db
  51. Why does dbDelta() not catch MysqlErrors?
  52. Is deleting orphaned wp_options entries safe?
  53. Is altering a default WordPress database table update safe?
  54. Huge wp_options table
  55. “MySQL server has gone away” since update to 3.8
  56. Custom DB_COLLATE (collation) value not working on fresh install?
  57. What causes the “max_user_connections” warning on WordPress frontend?
  58. what to do when your WordPress database is too large?
  59. Change all http to https in mysql databse?
  60. WooCommerce – Query for ordered products
  61. Large database causes slow load
  62. Error establishing a database connection – with Debug Data
  63. How to execute mulitple statement SQL queries using $wpdb->query?
  64. Delete duplicate rows from wordpress database where a column is duplicate in phpmyadmin
  65. Database slowdown after update to 3.4.1
  66. Can I transfer a mysql database to another site?
  67. WordPress and automated MySQL backups to a different host
  68. Database with mixed collation (utf8mb4 & utf8_general_ci)
  69. Query WordPress database by registered date and role
  70. MySQL Syntax Error upon restoring database from backup [closed]
  71. Tons of Twitter rows in my database
  72. Help running a MySQL query to update all wp_#_options tables in a Multisite install
  73. How to insert data into MySQL database from the form created in WordPress site
  74. Set Display Name to first and last name (phpmyadmin SQL Query)
  75. Size article thumbnails and retrieve them directly from database
  76. WordPress site uses MyISAM, should I switch to InnoDB necessary?
  77. Is it safe to convert tables from MyISAM to InnoDB?
  78. Emojis getting converted to “?”
  79. Migrating database / content of non-CMS site to WordPress
  80. Does WordPress ever need multiple databases?
  81. Why are no posts showing despite my apparently correct DB restoration?
  82. Select Multiple meta_value from WP DB; Single Query
  83. Is it possible to store visitors IPs in wp_postmeta table?
  84. Multiple postmeta with same name for one post in wp_postmeta table
  85. Which is more efficient? Using usermeta, or creating a new MySQL table?
  86. How to get the total number of meta_values based on a custom post type?
  87. How do I properly update the WordPress database password?
  88. wpdb_prepare with multiple or condition
  89. One post carries 30 postmeta values, is this too much?
  90. Is it possible to split database tables using HyperDB?
  91. Adding new row to wp_post table
  92. WordPress Install and Database on separate hosting?
  93. What happens if I overwrite the current wp_options table with a backup from a week ago?
  94. WordPress mysql table double prefixes
  95. SQL Error wp_commentmeta – incorrect table definition
  96. WordPress database error – Error in SQL syntax – I can’t identify any error?
  97. CRUD operations using WordPress database API
  98. delete post meta from db, even if does not exist?
  99. Storing data for a wordpress plugin
  100. How do I get the posts within a certain year/date(with sql query)?
Categories Database Tags database, meta-value, mysql, post-meta
search form display no result
Question regarding register_nav_menus();

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