0
votes
1answer
32 views

Convert all dates in field to Unix time, except those already in Unix time

I have a meta field that is mixed with MM/dd/yy hh:mm dates and Unix timestamp dates. How do I convert all of the MM/dd/yy hh:mm dates in the db to Unix? I have only limited PHP and SQL knowledge so ...
0
votes
0answers
71 views

How to parse meta value from user specific post to google charts?

I'm currently working on a project where i need to visualize the progress of users (fitness). For that i have created a custom post type with custom fields. I want to parse the meta values associated ...
0
votes
0answers
44 views

Delete duplicate custom field with specific vaule

I'm trying to delete specific custom fields that have been duplicated, however i only want to delete the fields with the value 0 in them. I currently have this code that will delete the duplicate ...
0
votes
0answers
88 views

Is it ok to delete empty meta values

I'm using database peek http://wordpress.org/plugins/database-peek/ to show my database structure and have noticed that wp_postmeta has 95073 rows in it. I noticed that a large part of them have ...
0
votes
0answers
83 views

SQL Statement to sort custom query over multiple meta fields with duplicates?

i'm normally doing more Design/CSS stuff, so please be patient if this question is a nobrainer... My question is as follows: I have a custom post type, that has multiple custom fields. Now i need a ...
0
votes
1answer
98 views

query specific posts according their custom fields, using sql SELECT

My posts have a bunch of custom fields, to help insert and display custom info easily. I am trying to build a search that would select and display posts according values of specific 2 custom fields. ...
0
votes
1answer
225 views

SQL: Select wordpress posts with given text string and add a custom field to them?

I want to select all wordpress posts that have a certain text string. Then to add a custom field to all those posts. Here is what I figured out so far but it doesn't work INSERT INTO wp_postmeta ...
0
votes
2answers
778 views

Up/Down voting system for Wordpress

Looking in all posts with keywords "voting system, upvote, downvote", I can't find a satisfying solution for this issue, except accepting one of the available plugins, spend a lot of time undersanding ...
0
votes
0answers
167 views

Convert date format in meta

I have been storing date format in meta key/value. I have been storing in this format (mm/dd/YYYY) now I need to convert that into (YYYYMMDD) SO I can run a date match in query. Please advice how can ...
1
vote
0answers
82 views

Meta Query And/Or

My question is very similar to Meta Query with AND & OR? . This question was answered in 2011 by @Otto. With the exception that my logic is different. I want to query, for example, posts with ...
0
votes
1answer
284 views

Bulk move (or copy) from a custom field to the post content?

I need to move (or copy) the contents of a custom field into the main post body, replacing any existing content. I need to do this for a few hundred posts...Is there a quick way of doing this? I can ...
0
votes
1answer
211 views

Show array of meta_value in Edit Post Coloum

what I'm trying to do is add a new coloumn to Edit post page (done) and in that coloumn show data taken from a set of custom fields (partially done). This is my code (I use it as a plugin so it ...
3
votes
3answers
2k views

SELECT max(meta_value) FROM wp_postmeta WHERE meta_key='price'… stops working when value is over 999

Overview: I am not trying to return a post. I simply want the single highest value for a particular meta_value across all posts... just the value itself. Details: I have added a custom meta_key ...
0
votes
1answer
313 views

Alter SQL query to return posts with unique custom field value, no duplicate values

I currently have a list of posts with the custom field "Name," with several posts having the same value for "Name." I would like to retrieve a list of posts that all have unique values for "Name." ...
3
votes
2answers
3k views

Retrieving custom fields with $wpdb->get_results

I'm trying to use $wpdb->get_results to retrieve an array of all posts including custom fields. I can retrieve the meta_key and meta_value columns like this: [meta_key] => state [meta_value] ...
1
vote
2answers
1k views

How to rename a custom field?

I have 3000 posts with that custom field name 'refer' and i need to change it to 'ref' for theme needs, instead of doing it manually i need a query or technique to change them all. Question 1 I am ...
1
vote
1answer
1k views

Order query by meta_value with multiple custom fields

I would like to get ordered all my posts with multiple cutom fields (WordPress 3). Exemple, I've 2 custom couple meta_key/meta_value : " order_submenuexpositions / numeric " " ...
5
votes
2answers
3k views

How to correctly call custom field dates into a posts_where filter using SQL statements

Currently I have the loop listing posts between two dates using the posts_where filter: function filter_where( $where = '' ) { $where .= " AND post_date >= '2000-01-01' AND post_date <= ...