WordPress stores user generated content, along with other configurable information, in a a database (typically MySQL).

learn more… | top users | synonyms

1
vote
2answers
263 views

Efficiency on displaying random authors based on large database

I'm trying to display a list of 5 authors randomly. Here are some solutions I had found: http://stackoverflow.com/questions/5502609/get-authors-randomly ...
1
vote
1answer
817 views

Extend the wp_users table

I'd like to to extend the wp_users table in my WordPress' database. Why? I want people to add more information about themselves when they sing up at my website. I know how to extend it, but I'm ...
1
vote
3answers
2k views

How do I add indexes to Wordpress Database?

I got a message from Hostgator about my account being suspended because of the load it put on their servers. This is about the fifth time this has happened. I am on a shared server. And they said it ...
1
vote
5answers
7k views

Will it break my site if I delete all transient records in wp_options table?

My site currently has an outrageous 500k+ transient records in the wp_options table. This causes the table to be crashed frequently and so be my site. I thought transient records will all expired ...
1
vote
1answer
3k views

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 ...
1
vote
1answer
2k views

How to close wpdb connection?

Is there any method to close connection similar to mysql_close() for wpdb in wordpress? Is it not necessary to close connection for global wpdb?
1
vote
2answers
246 views

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. ...
1
vote
2answers
1k views

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 ...
1
vote
2answers
63 views

Creating table with plugin is not working

After reading many question and answers and many had asked the same question I have been following the same instruction as the people instructed but my bad it's not working I have used ...
1
vote
2answers
172 views

How to use a different database to list and manage comments in the backend

I need to make Wordpress use another database (not the one specified in wp-config site-wide) on the "Comments" admin backend. I then must be able to edit, approve, delete etc. comments as usual. The ...
1
vote
1answer
100 views

Is it possible to store visitors IPs in wp_postmeta table?

Or in any of the other 11 Wordpress tables. I also need to store: submission date, name, contact number in the same table. What approach would be best? A custom table or using a standard table?
1
vote
2answers
253 views

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 ...
1
vote
1answer
2k views

How to update BuddyPress xprofile fields programmatically? [closed]

I update user info using wp_update_user function. I also need to update the table wp_bp_xprofile_data. Is there any function, where I can update data on wp_bp_xprofile_data table?
1
vote
2answers
125 views

Remove the deleted users avatar from list

Problem Hi everyone, I have a bit of a problem. I have a function that outputs the avatars of users that follow me . It works great, but if the user is deleted the avatars remain visible as a blank ...
1
vote
1answer
993 views

WP_Query Performance Issues with meta_query

I'm working on a custom template for a new theme that uses a WP_Query instance to select posts from 2 post types with 2 custom fields that are NOT empty. Depending on the section of the site, a ...
1
vote
3answers
159 views

Single database for multiple instances

I would like to create two instances of WP on a single domain. For example, I would like wp1.domain.com and wp2.domain.com to use a single database (same comments/posts). One for production and one ...
1
vote
3answers
1k views

Use one Wordpress database with multiple instances of one site

Is there a way to use the same database, tables and all, with two different domains? For example, two employees each have thier own subdomain to develop / test with, so there may be two instances of a ...
1
vote
2answers
956 views

Query from a different database than the default

I'm making a layout for a wordpress page. The layout needs to connect to a second database (both databases are in the same domain). But the problem is, when i execute just the file it works. But ...
1
vote
1answer
4k views

Connect forms in WP to external database

I want to use Wordpress for an existing site (coded in PHP). It has some forms (for member subscription, user can update their data etc.) which are connected directly to an existing database. I don't ...
1
vote
2answers
478 views

What's the most efficient database method to add and query usermeta?

What's the most efficient way - concerning the database - to add and query extra usermeta fields to a profile? I need to add four additional fields of numeric and text data to a user profile and then ...
1
vote
4answers
5k views

After server migration only the homepage works

I have recently changed hosting of my WordPress site to VPS.net. I have moved all of my files and imported the database. Everything appeared to be fine until I clicked a link and noticed that all of ...
1
vote
1answer
122 views

What's faster? One big query, or several smaller ones?

I'm working on an app that will require a query, via Ajax, for a bunch of posts in random order. Something like this: $query = new WP_Query( array( 'posts_per_page' => 50, 'orderby' => 'rand' ...
1
vote
2answers
102 views

Select Multiple meta_value from WP DB; Single Query

I am trying to retrieve each user's first and last name, phone, email, and address from the usermeta table. I'm having trouble selecting multiple meta_values, each with its own meta_key, using a ...
1
vote
2answers
54 views

How to correctly add a table to the Wordpress MySQL database

I want to add a new table to the Wordpress database. I need this one for a specific section of my Wordpress website, that requires something a bit different than what I can achieve through custom ...
1
vote
2answers
40 views

WordPress Backup

I'm learning how to backup right now and I'd like some validation. From what I understood, to fully backup my Wordpress I need two things. One backup for my database and another for theme files. The ...
1
vote
1answer
35 views

Database for development

While building plugins one of my biggest annoyances is that my development machine does not match a real world install. What I mean here is that my databases are lacking. I'll code something thinking ...
1
vote
1answer
35 views

Is the wordpress user-model changed in wpmu?

I'm running wpmu on heroku using a postgres extension. It works great, but I have a plugin that needs to get the userId based on the e-mail-adress. This is how it does it: $sql = 'SELECT id FROM ' . ...
1
vote
1answer
399 views

Separate table or usermeta

We are creating custom fields for users like annual income, gender, city, country, etc. There are about 10 odd new fields. We will be importing approx. 30,000 records for each user in a month through ...
1
vote
2answers
128 views

Where to store custom tagging data associated with a custom post type

My application allows users to add tags to an image (similar to facebook). Each tag can consist of up to 8 attributes and there is currently no limit on the amount of tags a user can add. At the ...
1
vote
1answer
687 views

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 ...
1
vote
1answer
38 views

How to store an extra (surrogate) ID when creating a post with wp_insert_post?

I am generating posts based on rows from a table on an existing database. If a row in the database gets updated I will have to update the respective post. The proble is that I have to find the post ...
1
vote
1answer
1k views

Custom search page and search by title, content and tag

Can someone review my code , I need to know better solutions or any bug. Okey ! , I made a PHP file to get search results by parameters and search by title , content and tag PHP's head look like: ...
1
vote
1answer
97 views

Why does WordPress rely on an fully qualified site_url with a 15-step plan for moving a site?

From the Moving WordPress codex page (emphasis mine): When your domain name or URLs change there are additional concerns. The files and database can be moved, however references to the old ...
1
vote
2answers
409 views

How to create and work with custom data / tables (i.e., for arbitrary data)?

Getting started on Wordpress just today. I noticed that Wordpress created tables in a mySql database (with name *.wrdp1) when I first set it up. These tables cover comments, posts, users, and some ...
1
vote
2answers
2k views

How do I copy a wordpress database?

I'm trying to migrate my wordpress site from an old host to a new host. The Wordpress Codex says "you can move by just copying your files and database." Copying the files is easy enough, but how do I ...
1
vote
1answer
262 views

One post carries 30 postmeta values, is this too much?

I have some data saved as post meta, occasionally some plugins may save an extra piece. Now I installed bbpress, it saves at least 10 pieces of post meta. Adding them together, there are nearly 35 ...
1
vote
1answer
919 views

WPML tables not deleted when removing multisite subsite, need help clearing up my sql-file! [closed]

I´m building a WP Multisite for a client that wants a multilingual site. Before choosing WP Multisite, I bought and tried out WPML. However that plugin didn't fit for the job so I deleted it and got a ...
1
vote
1answer
800 views

Within the database, where is the flag which says that a user has Super Admin rights?

I have an user in a Wordpress Multisite installation and have access to the Mysql database, I would like to give myself super-admin rights to access the wp-admin/network page. Where can I do it on ...
1
vote
1answer
71 views

Export all content from wordpress

Evening all. I've decided instead of upgrading the install of wordpress that I have, to just take the content (my writeups, comments, pages) and move them to the new site install. Is there an easy ...
1
vote
2answers
415 views

Bootstrapping Wordpress MultiSite Outsite of Wordpress - No $wpdb

I'm working on a plugin for a system to use Wordpress as the authentication backend, so that I can use my existing Wordpress users in another application. The plugin works great when running in single ...
1
vote
1answer
3k views

How does $wpdb handle COUNT(*)

I understand how to do simple queries and display results using $wpdb. This is my process: <?php $sql = 'select * from wp_votes;'; ?> <?php $votes = $wpdb->get_results($sql); ?> ...
1
vote
2answers
608 views

Wordpress doesn't show all posts in database

I have around 140 post in database but wordpress admin page shows just 50 post. How could I let wordpress shows all the posts in database? Thanks
1
vote
1answer
596 views

Is it possible to split database tables using HyperDB?

I'm looking for an answer from someone who's implemented HyperDB or has knowledge of it. I have a database which has just passed the 100mb mark a week or so ago, the problem is my host only allows ...
1
vote
1answer
2k views

Safe way to find last inserted id in a table?

Is it safe to use $wpdb->insert_id; to find the id of a last updated row id just after an update? ex: $sql = $wpdb->insert($table_name, $arrayWithDataToInsert, array('%s','%s')); ...
1
vote
1answer
204 views

WP database error for comments_popup_link()

I'm using the comments_popup_link() function to show the number of comments for each post in a loop. <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <?php if ( ...
1
vote
1answer
693 views

Adding new row to wp_post table

I want to add 2 more rows (for voting up or down) to my default wordpress posts table. Would those rows be deleted when I update my WP version, or cause any other problem? An alternative would be to ...
1
vote
2answers
24 views

wpdb custom post_type problem

I want to use custom post type in my custom SQL query, but, when I add the custom post type im my query, I get no results. Where's my probelm ? This is the code I've tried $top5_ov_performance = ...
1
vote
1answer
69 views

Best way to move live site local

I'm trying to move a big site that's currently live onto my local machine so I can edit locally. I'm using Wamp Server. I've tried using the Duplicator plugin but I'm getting several warnings and ...
1
vote
1answer
134 views

delete_option() and update_option() returning false

I know that when delete_option() or update_option() fail to perform their respective database interactions, they return false. Does anyone know why they wouldn't be able to perform these actions? ...
1
vote
1answer
154 views

Wordpress database error - Error in SQL syntax - I can't identify any error?

I am trying to write function that checks whether an email address is stored in my database or not. I've written the following PHP code:: function check_my_users( $email_address ) { global ...