0
votes
1answer
27 views

How to order posts by the user_login that corresponds to a meta_value (which is a user id)?

I'm trying to create sortable column headers for a CPT list, but I'm stuck on one piece. When clicking on an "Assignee" column head, I want the list to display alphabetically by the login name of the ...
0
votes
0answers
98 views

SQL query for converting post meta image url to featured image

WordPress guru, we have a question: We work on a website, which was not updated a while. Most of time it have wordpress 3.2 installed. We've updated it to the latest wordpress version, but ...
0
votes
0answers
103 views

Delete duplicate posts where meta_key is the same

I have imported some posts and this has caused some to be duplicated Each post (of a custom post type "property") should have a unique meta_key "import__id" value I need to delete all duplicate ...
0
votes
0answers
99 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
1answer
101 views

How do I insert a new meta key / value pair, but only if another meta key is present?

I need to add a new meta key and value part only on posts where another key is present (regardless of its value). I tried to use a query to automate it, but my SQL is quite limited Here's what I ...
-2
votes
1answer
2k views

cleaning up safely wordpress wp_postmeta table

In a effort to facilitate maintenance of my site, optimise page loading , and also helping out db migration , i am trying to cleanup the wordpress database of my site. i ahve realised the wp-postmeta ...
0
votes
1answer
156 views

mass delete posts based on metadata

I need to delete all posts that have a certain meta value for a certain meta key. I am looking for how to do this directly in the DB. So for instance, I have a meta field called "state", and I want to ...
0
votes
2answers
111 views

Which query method to use? (edit- wpdb syntax problems)

I am trying to create a query in order to get all the metadata from a custom post type named match_reports that is associated with a meta_key and meta_value in another custom post type named ...
0
votes
0answers
78 views

Ranking authors by post meta value

I have custom post-type with custom post-meta and i want to rank authors by post meta value.I can show the SUM of a meta value on author page with this code <? php $points = ...
0
votes
2answers
794 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 ...
1
vote
1answer
711 views

Select from wp_post and multiple meta_value from wp_postmeta

My lack of SQL skills has stopped me in my tracks here. I'm trying to select post_id, post_title and two postmeta values - the first has the meta_key of 'search_country' and the second a meta_key of ...
2
votes
2answers
261 views

What is an efficient way to query based on post_meta?

The problem I am having is when I allow users to filter posts it overpowers the database and things run extremely slow. I am unsure what the best way to query posts using meta values is. My site has a ...
4
votes
1answer
1k views

Export WordPress Posts and Meta Information in CSV format

I need to export all WordPress Posts and related Meta information using an SQL query. I've managed to export just the Posts but realised that the Meta information is in another table. Could someone ...
1
vote
2answers
2k views

Export entries and multiple custom field meta to .csv?

First time poster. I'm trying to export a bunch of custom posts out to a csv file so I can easily import them into a new database. I've ran the native export to xml, but it's not the correct format I ...
3
votes
4answers
7k views

Most efficient way to get posts with postmeta

I need to get a bunch of posts with their metadata. Of course you can't get metadata with a standard posts query, so you generally have to do a get_post_custom() for each post. I'm trying with one ...
2
votes
2answers
3k views

Query between two meta values?

How do I limit the query by two custom meta fields, a start date and an end date? This is what my data looks like: meta_key | meta_value | ------------------------| start_date | 20100131 | //Jan ...