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

learn more… | top users | synonyms

23
votes
8answers
16k views

Why is my database import losing text widget data?

I've created a site in WordPress on our development machine. In the theme we're using there are numerous widget zones to display text in (sidebar and front page). I've used simple Text widgets in all ...
22
votes
4answers
8k views

Database synchronization between dev/staging and production

I have a problem with WP database synchronization between development and production and I am wondering how other people solving it. I am aware about this question but it doesn't really cover the ...
20
votes
6answers
23k views

Using wpdb to connect to a separate database

I want to connect wpdb to another database. How do I create the instance and pass it the database name/username/password? Thanks
15
votes
3answers
9k views

MySQL Database User: Which Privileges are needed?

The short installation instruction for WordPress ("5 Minutes") state that: Create a database for WordPress on your web server, as well as a MySQL user who has all privileges for accessing and ...
13
votes
4answers
7k views

Post meta vs separate database tables

When developing plugins that requires data storage, what's the pros and cons of using one method or another ? The explanation given in the codex is not detailed: Before jumping in with a whole ...
12
votes
1answer
3k views

Should I use custom post types or a custom database tables for plugin development?

I'm fairly new to writing wordpress plugins, but I've jumped in the deep end already and I want to make sure I'm doing it "right" on my upcoming big project. I'm going to be heavily extending ...
12
votes
3answers
2k views

Multiple developers / editors working on a site in progress

Background I'm nearing the final stages of constructing my first fairly large WordPress site, and I'm now encountering some friction. For the most part, the site was developed on my local machine and ...
12
votes
1answer
247 views

How can I trust switch_to_blog()?

When I call switch_to_blog() with a blog id, I don’t know if that blog actually exists. The functions returns always TRUE. Here is my problem: switch_to_blog( PHP_INT_MAX ); $post = get_post( 1 ); ...
12
votes
3answers
4k views

Keeping WP database synced across multiple developers using git

I'm working on improving my git workflow as it applies to my WordPress development projects. Often, when developing a content management system, I'll create a development server (like ...
11
votes
3answers
20k views

How do I show data from gravity forms in my template? [closed]

Preface I've installed gravity forms, created a form and users are submitting data to my site. What I want to do is show the data users are submitting to my site on one of my pages. I know there's ...
11
votes
3answers
585 views

Performance of my permalink structure?

I have read the discussion on the performance of different permalinks on the wp hackers mailinglist, THIS forum and around Google. I could however not really deduce if the permalink structure I have ...
10
votes
4answers
1k views

Is it bad practice to create own table for a plugin?

If I want to save settings for my plugin then it is pretty easy and straight forward. Now I would like to save to the database a bit more. A file name, and 3 other values that only apply to that ...
10
votes
2answers
4k views

Wordpress Database Slow - should I switch to InnoDB?

I have a WordPress site with well over 10k posts, and things are starting to get very slow whenever I am adding and editing posts. Pages load nice and fast for users, along with the admin lists of ...
10
votes
1answer
713 views

How do I make an HTML table from a database table?

is there a built-in wordpress function to make the HTML or should I use plain-old PHP?
10
votes
1answer
143 views

How can I make updates to a site, on a development copy, but then move updates back without overriding live site's evolving database?

I've tried to be as descriptive in the title as possible, and I know this question has been asked in before in various forms but I could not find good answer to it and it's are to imagine that no one ...
9
votes
1answer
2k views

When is the 'post_content_filtered' column in database cleared by WordPress?

Some WordPress plugins (although very few) use the post_content_filtered column in database to save some data related to a post. For example, Markdown on Save stores the markdown version of a post ...
9
votes
3answers
640 views

What's a good strategy for planning WordPress DB growth?

Hoping for some feedback on the topic of optimizing and staying on top of performance as a WordPress database grows... to paint a picture.... let's say you have a WordPress / Buddypress MU site that ...
9
votes
2answers
4k views

The MySQL alternatives: Do Percona Server and MariaDB work well with WordPress, and do they make WordPress go better?

Lately I've been reading about MariaDB and Percona Server, two strong alternatives to MySQL that have gained popularity since Oracle bought Sun. As far as I know, both of them could be used with ...
8
votes
4answers
3k views

Are There Any Plans for Wordpress to Support Databases Other Than MySQL?

I've long wished Wordpress would support SQL Server, but it would also really amazing if it supported MongoDB (for example.) My question is are there any plans to do so, at all? Is the core ...
7
votes
4answers
1k views

How can I delete orphan keys in WordPress database tables?

In particular in table wp_options. After almost 2 years of blog production it seems increased a lot, and I don't know how many crap is in there. Do you know a plugin that works with WordPress 3.0 or ...
7
votes
3answers
23k views

How to integrate custom database table in Wordpress and using Wordpress functions

I'm on Wordpress 3.0.4 and I'm having a hard time deciding which way to go. The following is my problem: I have a mysql database table widgets, with about 10 properties like id, size, color etc. ...
7
votes
2answers
508 views

How can I make a WordPress database portable and url independent?

Issue I am about to embark on some WordPress development in a multi person team environment. (3 or more people working on the same codebase at a time, each developing locally) With other CMSes we ...
7
votes
2answers
514 views

Why does get_term() require taxonomy? Are term_ids not unique?

A related WPSE question asks how to get the term by specifying ID only, without specifying taxonomy. My question is more philosophical. Generally, stuff in WP core is there for a reason. I'm trying to ...
6
votes
2answers
2k views

Default table collation on plugin activation?

I'm following this to make my plugin auto-create a table when the plugin is activated, but what happens is that while all the tables (the whole db) are utf8_general_ci, the newly created table is ...
6
votes
2answers
597 views

Is there a plugin that will override the “Error establishing a database connection” message?

My provider's database server recently had some downtime and my site was displaying the classic "Error establishing a database connection" message for about an hour. I knew what the problem was but ...
6
votes
2answers
302 views

Does wpdb add considerable overhead on queries with large result sets?

I am working on backup-related plugin and from some research of existing plugins - they seem to favor using PHP's mysql_* functions, rather than $wpdb. Is $wpdb overhead considerable enough that it ...
6
votes
2answers
747 views

Custom Post Types, or completely custom?

I'm currently in the process of redeveloping my website. I've decided to use WordPress as its CMS, rather than coding everything from scratch. It's a fishkeeping website, consisting of species ...
6
votes
3answers
3k views

WordPress sharding: which multi-DB plugin to use?

I've got a WordPress multisite installation that's hosting enough blogs I need to shard the database. I see there are three plugins available to spread WordPress across multiple databases: ...
6
votes
1answer
102 views

Reset Post IDs to less than 64bit integer

I have been running Wordpress for many years and have about 26000 posts. At some point my post ids have exceeded a 32bit integer and I am now locked into using Wordpress on a 64 bit system. I am ...
6
votes
2answers
5k views

DB connection error after copying a WordPress Multisite instance to a second location

Here's my setup. I have a Multisite instance running at http://example.com, and I want to do development and staging. Moving an existing Multisite instance of WP onto localhost is a nightmare, so I'm ...
6
votes
1answer
706 views

Would switching to InnoDB from MyISAM improve performance of comments table?

A site I've built gets lots of comments in a short space of time - so perhaps 100 comments might be left in 5 or 10 minutes. This seems to cause a pretty heavy load on the database, especially when ...
6
votes
2answers
220 views

How to check if image is already stored in a site's post database? (network)

I currently have configured Wordpress so that a post can be copied to other sites within a Wordpress network. However, a post may be broadcast more than once, and I want to check if the image is ...
5
votes
8answers
495 views

Backup the Database and Restore from the Backup?

I am using WordPress 3 and would like to backup the database to my computer (a Mac). My webhost is using PHP safe mode, so that sometimes limits what plugins I can use. What is a good way to do a ...
5
votes
2answers
322 views

WordPress database scalability from the code perspective

I have read through multiple questions here on StackExchange that concern WordPress scaling and the common opinion is that WordPress is indeed highly scalable provided you have the infrastructure to ...
5
votes
2answers
2k views

Count & Display Database Queries

I'm looking for an solution how I can count and display all queries in a WordPress site. Does anybody know, if there is an good plugin? Otherwise it would be an solution to check the queries on the ...
5
votes
2answers
814 views

Using transients in conjunction with memcached

I was hoping someone could clear the air for me when it comes to using transients with memcached. When running a plugin like w3-total-cache, are there any actual performance advantages to using ...
5
votes
3answers
732 views

Resetting comment count

Recently, I had to move to another domain and had to recreate all my MySQL tables on the enw server. I noticed that for some posts, the number of comments is doubled. Example - ...
5
votes
1answer
640 views

How does Wordpress handle MySQL row lock errors?

If there is a WordPress plugin which updates rows in a custom table, but that update encounters a row lock, what happens? E.g. two users simultaneously fire an update on TABLE1, one setting AGE=1 and ...
5
votes
2answers
4k views

Checking if Database Table exists

I read the wordpress codex and professional wordpress. It seems both use something like if($wpdb->get_var("SHOW TABLES LIKE '$table_name'") != $table_name) { to determine if the table exists. Is ...
5
votes
2answers
602 views

What for is the table “wp_commentmeta” exactly?

I have been reading about the Database Description of Wordpress. I haven't understood the meaning to the use of the table wp_commentmeta. The documentation says: Each comment features information ...
5
votes
1answer
223 views

Using a database view = evil incarnate?

I'm at a point in doing some WordPress plugin development where from what I can tell I either have to create an entirely new plugin or I can create a database view. The client wants some simple logs ...
5
votes
1answer
264 views

When is it appropriate to create a new table in the WordPress database?

For a client we'll need 29,000 terms (all the highschool's in the US) and each term needs 6 meta items (address, phone...). My initial thought was to store the term meta information as suggested in ...
5
votes
1answer
225 views

Should I use Transients with W3 Total Cache APC Caching? [closed]

Should I use Transients in my queries like this? <?php if ( ! $my_paged = absint( get_query_var( 'paged' ) ) ) $my_paged = 1; if ( ! $my_query = get_transient( "567recent_$my_paged" ) ) { ...
5
votes
1answer
162 views

Performance Gains of Relational DB Setup

Our team is working on the 3rd of large WP sites for a client, and contrary to most "typical" WordPress setups, our projects are generally experience lots of requests, data pulls, and general content ...
5
votes
1answer
397 views

WP Multisite: load content from site X on site Y

I'm running a WP multisite-network on my professional website (http://mydomain.com). I'd like to play around with jQuery Mobile and deliver a different website and web experience to mobile users, so I ...
5
votes
1answer
210 views

How can I safely increase the character limit for post passwords?

When I want to protect a post on one of my blogs, I like to use a passphrase instead of a password (albeit purely for the sake of creativity, not security — they're stored plainly anyway). However, ...
5
votes
1answer
1k views

Forcing nickname as display_name in custom edit profile template

Context I've created a front-end "edit profile" template. When I input a value into the nickname text box only the nickname is updated. The default WordPress forum has a select menu that ...
5
votes
1answer
350 views

Slow wp_term_relationships query

I'm running a large WP instance (currently has 28,000+ posts in custom types) and have been experiencing some odd slowdowns. Upon analyzing the MySQL slow query log, one of the problem queries is: ...
5
votes
4answers
4k views

Can posts have parents?

Are posts supposed to have parents? If so, what would that mean for a post to have a parent? Also, if there are some constraints to posts having parents, then where is that enforced? Not in the DB as ...
4
votes
7answers
3k views

How to move existing Wordpress wp-content folder along with database to new server and new domain name?

Running WP 3.5.1 on a LEMP stack (over at Linode) ... I have a wp-content folder for a WP site along with a full backup of the database. The URL of the site was something like: ...