Questions tagged [post-meta]

Post meta is a data set in WordPress that contains additional core as well as custom post information.

Post meta is a data set in WordPress that gets saved inside its own table named {$wpdb->prefix}_postmeta. It contains the following columns:

┌──────────┬──────────┬────────────┬──────────┐
│ post_id  │ meta_id  │  meta_key  │meta_value│
├──────────┼──────────┼────────────┼──────────┤
│ 1233456  │ 1234456  │     foo    │   bar    │
├──────────┼──────────┼────────────┼──────────┤
│bigint(20)│bigint(20)│varchar(255)│ longtext │
└──────────┴──────────┴────────────┴──────────┘

The post_id is needed to do JOINs, so the {$wpdb->prefix}_posts table can connect to this table.

The data that gets saved here by core:

  • _edit_lock
  • _edit_last
  • _thumbnail_id

This table also saves the data entered in custom fields.

And it's as well meant to hold additional custom data. If you want to search by custom field with a meta_query, it's better to use a single entry per value. Else you save it as serialized array (which core will do on it's own).

111 questions
-1
votes
1 answer

Is there any way to write SQL query to extract data from a postmeta table in wordpress?

I have a directory website running on wordpress. I have a lot the the business listings stored in the postmeta table. I am tasked to retrieve that data to be exported in csv file using either SQL queries or other means. Is there way to write SQL…
-1
votes
1 answer

MySQL Chokes on IS NULL 11,000 records

I found a similar question that was resolved with indexes but I found no changes to query speed, about 80 seconds to return the games section. This is pulling meta values from a WordPress database into a temp table to compare if the updated fame…
Radium Chris
  • 61
  • 1
  • 8
-1
votes
1 answer

How to display tags order by asc or desc when post add and edit in wp-admin

I want to display Tags (Post Meta) order by in post add and post edit. Also I want to display Tags in drop down list.
-1
votes
1 answer

get_post_meta for inline CSS

I have a custom field with name and value (case sensitive) as follows: style; rgb(240,180,41) The code to retrieve this is included within the loop on my single.php file:

Chris L
  • 109
  • 8

-1
votes
1 answer

How do I remove text "by" and " | " from post meta in Divi?

I want to remove these highlighted texts from meta section
Noor Khan
  • 33
  • 1
  • 9
-2
votes
1 answer

What is it? --> a:5:{i:0;i:14357;i:1;i:14358;i:2;i:14359;i:3;i:14360;i:4;i:14361;}

a:5:{i:0;i:14357;i:1;i:14358;i:2;i:14359;i:3;i:14360;i:4;i:14361;} serialize array in php without size and double quotes? It's stored in a wordpress woocommerce postmeta table as meta_value. How can I build it from an array in php for insert in…
FOX
  • 1
  • 1
1 2 3 4 5 6 7
8