Articles of database

Large database causes slow load

I have a 2GB WordPress database (using InnoDB Storage Engine) and I noticed my site loads slow when I press the publish button right after I selected a featured image in the media library. I had a look at my tables and noticed wp_postmeta is the biggest table and wp_posts the 2nd biggest out of […]

Getting all the users who have author privilege

Can anyone tell me how to get all the users who have author privileges by querying the DB in WordPress and order them by number of posts written by them. I use the following query to get all the users from DB: $authors = $wpdb->get_results( “SELECT ID, user_nicename from $wpdb->users ORDER BY display_name” );

greatest() function returns undefined property

I’m using the mysql GREATEST() function to compare two table fields and display in a loop either one with the highest integer value. The 2 fields consist of vote scores for posts: UP or DOWN. function vote_results($post_id) { global $wpdb; $table = $wpdb->prefix . “post_votes”; $results = $wpdb->get_row( “SELECT GREATEST (up, down) FROM $table WHERE […]

Should I remove transients from the wp_options table?

I have been doing some cleaning up in the database of one of my WordPress installs, and I noticed that the wp_options table was about 2.1mb, and had 1200 rows. I’ve gotten it down to around 800 rows, and 1.2mb. However, there are a bunch of transients. Should I remove these? I know they don’t […]

Custom Taxonomies Incorrectly Counting Revisions?

(Moderator’s note: The original title was “The count of my custom taxonomy is incorrect; it’s counting revisions”) Has anybody run into this before? I’ve added two custom taxonomies, and the count column of the wp_term_taxonomy table is being set incorrectly. It appears to be counting revisions in addition to the published post. I’ve poked around […]

What is the fastest way to generate a unique id number when registering a user

I have a client who wants to register users and give them a unique ID number when they complete registration. (Kind of a member number sort of thing) Can I just setup the WP member table to start id numbers in the high 10 digit range? User experience would be: user would visit the site […]

How to build a movie database with wordpress?

I’m looking for a plugin to build a movie database like Popcritics The plugin would permits me to add custom info (like CustomPress can do) about a movie. Ultimately, the plugin could permit users to register for saving favorites movies. Do you know of one ?

How do I reset a self-hosted WordPress URL?

i was using a wordpress install on an ubuntu server virtual machine. At first the adapter was host-only at an address of 192.168.55.55. The host had this on a vboxnet0 subnet. i changed to bridged adapter to try port forwarding from the router, and now i cant access the page with the new address. the […]

Looking for a subscriber list management system

Is there any plugin that enables the creation of forms and has a smart tool for subscribers (not site visitors who registered) database management? I’m looking for a plugin that does that for a long time for different type of needs. For example, event subscription, workshops, courses etc. I don’t need an event/calendar tool, just […]

How to Query Database for posts with certain Taxonomy Term

I want to write a select query to return data on only posts which have are associated with the taxonomy term food-and-beverage SELECT wp_postmeta . * , wp_posts.post_name FROM wp_posts, wp_postmeta, wp_terms, wp_term_relationships WHERE wp_posts.post_type = ‘projects’ AND wp_posts.post_status = ‘publish’ AND wp_posts.ID = wp_postmeta.post_id AND wp_term_relationships.object_id = wp_posts.ID AND wp_term_relationships.term_taxonomy_id = wp_terms.term_id AND wp_terms.slug […]