Post meta is a data set containing additional core as well as custom post information.

learn more… | top users | synonyms

4
votes
1answer
86 views

So much data in postmeta

Last year started using custom fields and in one year I have 230,540 rows in wp_postmeta table. This year will add more data and new fields and I don't know what to do, to create new table or continue ...
-1
votes
1answer
50 views

Access post meta just after publishing

the following code is supposed to store post meta of the recently published post to the variable $temp. But it doesn't, $temp is always empty. This seems to happen because "transition_post_status" ...
0
votes
0answers
10 views

Adding description to wordpress blog post through wp-admin panel

Is there a way to add a description to my Wordpress blog post through wp-admin panel?
0
votes
1answer
32 views

Search one custom field?

In posts there is in custom field named "color". I have custom search page template, and I would like to show search results only from that one custom field. How to limit search to look just in one ...
0
votes
0answers
9 views

Remove metabox container and header

Is it possible to remove the whole header of my metabox (title+toggle icon) and the container (.postbox) ? I wonder I can use css to remove them, but is it the best solution?
0
votes
1answer
28 views

Use WP_Query in shortcode

I'm trying to get meta information from the first four posts that have a meta key equal to Sedan, then format that posts meta in order to set up gallery type display boxes. I believe it has something ...
0
votes
0answers
10 views

my page title combines with site name by yoast seo, please help [on hold]

My page title combines with my site name due to yoast seo plugin, homepage title (ex if my page title is news and site is "your site" it combines as newsyour site but it should be as News-your site) ...
0
votes
0answers
15 views

Can't save meta field value if the title not set

I'm using the example from WordPress Codex (https://codex.wordpress.org/Function_Reference/add_meta_box#Procedural) to add and save meta box values. Unfortunately I can't save the value of the meta ...
0
votes
0answers
10 views

Pre_get_posts meta query value serialized array using multiple URL parameters

Using the 'pre_get_posts' action I'm looking to return all posts which match multiple URL parameters by defining the meta_query. For example: example.com/?size=large,small&options=green,blue,red ...
0
votes
0answers
9 views

How To Add Custom Meta Field Select/Radio Box to Post List Bulk Edit Mode

How can you add a radio fieldset to a custom post-types post list bulk edit screen for a custom meta field? Please provide in depth code example and explanation and thanks in advance. The ...
0
votes
1answer
15 views

Structure of postmeta meta_value for woocommerce product download

So I'm working on a monster script to port all of our existing stuff from Joomla/Virtuemart to Wordpress/WooCommerce. So far I've got just about everything done with moving over our product ...
0
votes
0answers
13 views

Need to make a “Meta Box” for Post search

I have a theme, where i can associate post with page there is called ( Hubs ) its part of the actually page. I have figure out so much that when i post a news about something, and it have to go into ...
0
votes
1answer
16 views

Storing post_meta fields in array

I need to have 8 separate post meta fields on each post in wp-admin (shown in a custom meta field box). I'd like the data from these 8 fields to be stored in an array as one post_meta field for easy ...
1
vote
1answer
109 views

How do I add advanced custom fields / meta fields to Elasticsearch? [closed]

I am using the plugin ElasticPress. I'd like it to index some extra (advanced custom) fields. The only info I can find is this comment by one of the developers: [...]if you would like to add ...
0
votes
0answers
33 views

How can I convert this SQL query to delete duplicate posts by specific meta_value instead of post_title?

This query works exactly as it should to DELETE all duplicate posts by post_title for my custom post type: $sql = " DELETE a.* FROM wp_posts AS a INNER JOIN ( SELECT ...
0
votes
0answers
22 views

Convert meta description into corresponding excerpts / yoast seo plugin

I m using Yoast SEO plugin on my blog. I never filled excerpts manually, but filled the meta description for each posts. But now for some reasons i need to use get_the_excerpt hook and I have never ...
4
votes
2answers
175 views

What is the different between an attachment in wp_posts and an attachment in wp_postmeta?

After the Woocommerce dummy products are imported, I notice that in the database, there are different records in different tables but point to THE SAME photo attachment. The question is why? What are ...
0
votes
4answers
105 views

Remove href tag from wp_postmeta in 34,000 posts?

I'm using Godaddy Hosting, PHP 5, and Wordpress 4.2.1 I have 34,000 + posts that need outdated href tags removed. I am able to remove tags, one post at a time, by using this code in a page template ...
0
votes
2answers
39 views

WP_Query Posts by Metadata from Option Tree

I am doing a WP_Query trying to filter out the posts by Metadata. $args = array( 'ignore_sticky_posts'=> 1, 'post_type' => 'post_projects', 'post_status' => 'publish', ...
0
votes
0answers
17 views

how to show posts based on meta value for a logged user in admin pannel

I need to show posts in admin panel based on meta value. I have a meta box when logged in user want to add new post, he should checked the users in meta box that can view that post. when that user ...
3
votes
1answer
89 views

Use REGEXP in WP_Query meta_query key

I know I can use REGEXP in WP_Query like this: $query = new WP_Query(array( 'posts_per_page' => -1, 'post_status' => 'publish', 'meta_query' => array( array( ...
0
votes
0answers
20 views

Wordpress User Meta Open Graph and WPSEO Yoast different in production and staging environments

When using Facebook share to share a link I have been using WPSEO and custom hooks to update the Open Graph meta information based on custom parameters in the url in the theme's function.php file. /* ...
0
votes
1answer
35 views

WP_Query - Accessing MetaValue from Query Result

Have this code. In doing a var_dump the meta_value is being retrieved under public object meta_value. I'm trying to access this data in a "WordPress" away instead of a more traditional PHP way. What ...
0
votes
1answer
81 views

Complex strcuture as CPT or taxonomy for use in woocommerce product variations [closed]

In woocommerce, I've got a bunch of products, which all have a certain material assigned. My current implementation of a material is a CPT (with about 20 fields (color, transparancy, reflection, ...
0
votes
1answer
43 views

Disable Facebook Comments Automatically On CPT

I am working with the Facebook comments plugin. I have a custom post type that never uses Facebook comments. I am trying to create a function to automatically turn these off when the custom post ...
0
votes
0answers
30 views

WP-API : post_meta not updated… but have another entry

When creating a post, I put some post_meta here is the code for the creation edition and deletion of a post https://gist.github.com/eduplessis/dc530523f0b98ae233dc and here is the result of the ...
1
vote
1answer
54 views

Execute action after post is saved with all related post_meta records (data)

I have to execute custom PHP code after new post is saved with all it's meta data. My question is how to achieve that? Tried with save_post action, but it executes before meta records are saved, so I ...
1
vote
1answer
55 views

Sorting and limitation with pre_get_posts

This is my third question regarding WP queries and pre_get_posts (sorry about that) but I cant give up one step before the full success :) So the story - my query is limiting front page posts to ...
4
votes
4answers
193 views

get registered metaboxes by post type or post ID

I am looking for a method to get the registered metaboxes for a specific post type (or post ID) when on a separate, unrelated post type. I am working on making a custom "editing" post type for a ...
4
votes
1answer
139 views

How can merge two arrays values in one array and save in database

I am working on WordPress upload meta fields. When user upload images the images are sized in two dimension one is "thumb" and one is "big" and they re sized very perfectly. I save both of images ...
0
votes
0answers
18 views

Dynamic CSS for CPT that requires post meta data

I have an, admittedly weird, CPT structure. I have two CPT's, one is 'section' - which is basically meant to represent a tag in HTML - and the other is 'sectioned_page' - which displays user chosen ...
0
votes
1answer
33 views

Why is get_post_meta returning an array when I specify it as single?

The documentation from get_post_meta makes it sound as if the single argument will determine whether or not meta values are returned in an array or not. For example: // If I set single to false, or ...
0
votes
1answer
29 views

Display post meta conditionally based on it's value

I have a custom field that's a radio button with 3 choices (yes, no, other). What I'd like to do is the following: [If custom field value is yes] Display something here [elseIf custom field value ...
0
votes
1answer
34 views

Can't get post ID using wp_insert_post_data

I have 3 custom fields as shown below. I want to use them to generate the title when I save/publish... etc The code works if I insert the post id as a number but not like this... function ...
0
votes
0answers
19 views

How to manipulate Wordpress custom fields to implement OG Tags on individual Posts

Hello my name is Erin and I have just started sharing my website content onto Facebook. The problem I've run into is that I can not control the description, image or title of the post. After doing ...
0
votes
1answer
20 views

How to add post reference field to a plugin?

I am trying to add a field to a custom post type through a plugin I am creating. One of the fields I need is a post reference / link to field. Any ideas on how to do this? In the WYSIWYG when you ...
0
votes
1answer
22 views

Filter query posts by the count of metas for a meta key

I know it is possible to filter queries to order posts by the numeric value of a meta. For example, I store the number of total likes for a post in a single meta key : ...
0
votes
0answers
15 views

Detect DOM Changes in Custom Metabox

I have a scenario where I use a custom metabox that contains two tables. One table contains a select list which a user can then add details about the selection. When complete, they click a button to ...
1
vote
0answers
32 views

How to compare two posts including their meta fields on a scalable base?

I have set up a wordpress in a way that posts can be cloned and be altered by a different author. whenever this is the case, i want the administrator to be notified via an additional tab in the ...
0
votes
0answers
16 views

help with wordpress post_meta saving and updating

i have this code which works fine, i can input information, save information, retrieve information no problem but if i want to erase an existing information to leave the field blank it will not erase, ...
0
votes
0answers
50 views

set s3 image as a featured image in wordpress post while posting the post programatically from an external source

I am pretty much new to wordpress. My requirement is that i need to make a post from an external source using ajax to wordpress site. The post data merely contain "posttitle,description,etc..." and an ...
0
votes
1answer
20 views

Save values generated via API as custom meta fields

I'm using the IMDB Connecter plugin to grab meta data for movies and I'm wondering if I can save some of the information it generates as custom meta data. Basically, I want to be able to save the ...
1
vote
3answers
94 views

Orderby meta_value only returns posts that have existing meta_key

I have the following wp_query: $args = array( 'post_type' => 'news', 'orderby' => 'meta_key', 'order' => 'ASC', 'meta_key'=>'custom_author_name', ...
0
votes
0answers
72 views

Undefined index error in custom post metabox

I'm getting this error with my custom post metabox. The custom post and metabox works fine, but if i have debug on and when i try to save any other page or post, i will get an error: Notice: ...
0
votes
1answer
63 views

Get $post->ID from a URL

I have a custom post type called music. I have created a custom template as a normal page to show some stats for the musicians. I have a page where they can see all there songs and have added a ...
0
votes
0answers
42 views

Meta query compare timestamp if exists

I have a custom post type with a start and end date timestamp. These fields are not required so they may not exist. What I want to do is query and show all posts that don't have the end date set or ...
1
vote
1answer
45 views

Safe to delete blank postmeta?

We have a lot of rogue custom fields. I feel that we can clear significant space in the DB if we remove the blank values. If I query my database with the following: select * from wp_postmeta where ...
1
vote
1answer
41 views

Custom post meta values reset by autosave [duplicate]

I have created a post view counter plugin that increments a count each time a post is viewed/refreshed. The count is working fine however if editing a live post the autosave functionality appears to ...
0
votes
1answer
88 views

Reduce or prevent calling of update_meta_cache

My theme calls the update_meta_cache() function 58 times per page! This function appears to run the following query based on the post in question: SELECT post_id, meta_key, meta_value -> FROM ...
0
votes
1answer
89 views

Change meta tags programatically

Is there a way to change the meta tags not in the head but in a template file through code? I would like to change the meta tags <meta property="og:title" content="title" /> <meta ...