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

learn more… | top users | synonyms

19
votes
4answers
6k 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 ...
18
votes
8answers
12k 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 ...
17
votes
6answers
16k 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
14
votes
3answers
5k 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
5k 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
2k 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 ...
11
votes
3answers
3k 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 ...
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
681 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
3answers
562 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
3answers
1k 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 ...
9
votes
1answer
129 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 ); ...
8
votes
3answers
10k views

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

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 ...
8
votes
3answers
516 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 ...
8
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
1answer
117 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 ...
7
votes
4answers
19k 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
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
1answer
815 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 ...
7
votes
2answers
450 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
475 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
1k 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
437 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
261 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
697 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
2k 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
628 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
190 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
480 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
280 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
3answers
552 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
473 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
1answer
187 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
229 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
2answers
4k 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 ...
5
votes
1answer
138 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
299 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
181 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
860 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
150 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
3answers
3k 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
2k 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: ...
4
votes
2answers
1k 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 ...
4
votes
2answers
274 views

Is it possible to define two databases for one installation?

Is it possible to define 2 database for one wp installation, I have searched but there are options for one database and 2 installations. I want this because, one of my clients site is hosted on ...
4
votes
2answers
610 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 ...
4
votes
2answers
2k views

Get posts by menu ID

I'm a little stuck here. I have a menu in Wordpress with some posts in it. What I would like is to retrieve all the posts as objects. I think I'm pretty close, but the SQL query doesn't seem to work ...
4
votes
6answers
415 views

How can I migrate from another platform to WordPress (using the same domain) and launch when ready?

Currently, I have a blog that runs atop Tumblr, which is relatively young (3 months old or so, maybe 25 posts altogehter) that I want to migrate to a self-hosted Wordpress installation. I've installed ...