WordPress stores user generated content, along with other configurable information, in a a database (typically MySQL).
18
votes
4answers
4k 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 ...
14
votes
6answers
10k 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
13
votes
7answers
8k 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 ...
11
votes
3answers
2k 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
3answers
515 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 ...
9
votes
4answers
3k views
Post meta vs Seperate database tables
When developing plugins that requires data storage, what's the pros and cons of using one method or another ?
The explication given in the codex is not detailed.
Before jumping in with a whole ...
9
votes
2answers
3k 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 ...
9
votes
1answer
624 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?
9
votes
2answers
3k 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 ...
8
votes
3answers
723 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 ...
8
votes
3answers
820 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 ...
7
votes
1answer
1k 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 ...
7
votes
4answers
941 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
326 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 ...
7
votes
2answers
3k 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 ...
6
votes
4answers
14k 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.
...
6
votes
4answers
2k 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 ...
6
votes
2answers
967 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
628 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
459 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
303 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 ...
6
votes
2answers
128 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 ...
6
votes
2answers
407 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 ...
5
votes
2answers
187 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
1answer
292 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
3answers
340 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
2answers
227 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 ...
5
votes
2answers
202 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 ...
5
votes
1answer
92 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
132 views
How can I 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
531 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 ...
4
votes
7answers
454 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
8answers
445 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 ...
4
votes
2answers
186 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
365 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
1k 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
2answers
2k 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 ...
4
votes
6answers
374 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 ...
4
votes
3answers
238 views
Is it possible to switch the data layer within WordPress?
WordPress is undoubtely very customizable using plugins, but every customization possibility surely has limits defined by the underlying architecture.
For those familiar with WP architecture and ...
4
votes
1answer
200 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 ...
4
votes
1answer
171 views
What is the most secure way to store post meta data in WP?
Sony's recent security "holes" showed how unsafe it can be to store data unencrypted. As some of you may know, I 'm working on re-releasing the free CRM theme Driftwood.
What is the most secure way ...
4
votes
3answers
564 views
Performance tips for a large user base [closed]
I’m preparing a site with many users (100.000+). Since the output depends on the current user’s relation to some custom post types and taxonomies a static cache won’t help much.
Besides using a ...
4
votes
2answers
991 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
2answers
3k 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 ...
4
votes
1answer
130 views
What is the advantage of the wp_options design pattern?
As we all know, a design pattern that is used frequently in Wordpress' DB code is the idea of persisting data for a particular object (blog/post/comment), indexed with a particular name or key.
We ...
4
votes
2answers
2k views
WooCommerce with thousands of products - site is very slow - optimize db queries?
So far I've got around 8,000 products in my WooCommerce and the product page on the front end takes several seconds to load, even after caching.
My VPS host says that I should have multiple ...
4
votes
1answer
138 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 ...
4
votes
1answer
175 views
find a random blogid across my multisite network that has at least one post published
I need to find a random blog across my multisite network that has at least one post published of a certain post_type, and return its blogid as a variable so I can use it in a switch_to_blog() call.
I ...
3
votes
4answers
3k views
Site stuck in “Database Update Required” loop
I just updated to 3.1.3 and now when I go to the admin I get the "Database Update Required" /wp-admin/upgrade.php screen. I click 'Upgrade Now' and it says it's done, but then trying to access ...