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

learn more… | top users | synonyms

4
votes
3answers
254 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
2answers
8k views

How to get the post publish date outside the loop?

I need to pull out the post publish date in order to make the post post auto expire. The thing is I can't get the right publish date. Here is my code: global $wpdb; $post_ids = ...
4
votes
1answer
217 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
693 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
109 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 ...
4
votes
1answer
102 views

Where can I find the database changes between WordPress versions?

Given vX and vX+1, how do I find the difference between each versions database schema?
4
votes
2answers
2k views

where is permalink info stored in database?

I see that I can edit permalink information in wp-admin page > settings > permalinks. However, where is that information actually stored in the database?
4
votes
1answer
308 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
100 views

Presentation vs Content in WP DB-Tables

Presentation vs Content in WP DB-Tables Is there a clean separation between the WP tables involved with presentation vs content? I would like to take my time working up presentation changes, such ...
4
votes
2answers
5k 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
261 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 ...
4
votes
0answers
200 views

WordPress database error: [Query was empty] [closed]

I'm using $wpdb to connect to a different database than my WordPress one like this: $newdb = new wpdb(DB_NEW_USER, DB_NEW_PASSWORD, DB_NEW_NAME, DB_NEW_HOST); I need to insert multiple rows into ...
3
votes
3answers
1k views

Creating two database tables via plugin

I'm working on a voting plugin for my site and I want to create 2 tables: one that stores votes and another that stores voter ips. In Codex it suggests to use an if statement to see if the table has ...
3
votes
5answers
4k 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 ...
3
votes
2answers
350 views

Does dbDelta delete columns as well?

I created a table using the dbDelta function and then removed a few columns and added a few. The new columns did get created but the old columns did not get deleted from the table. Is there a ...
3
votes
3answers
7k views

insert data in database table from plugin with WP3.1

I am quite new in WP Plugin World. I am trying to develop a plugin in WP 3.1 when I am trying to insert data into my table named "wp_enam" in the following way: $wpdb->insert($wpdb->enam, ...
3
votes
2answers
926 views

How To Export/Import WordPress (MySQL) Database Properly Via Command-Line?

Normally, a MySQL database can be exported and imported using these simple SSH commands: Export: mysqldump -u USERNAME -p DATABASE_NAME > filename.sql Import: mysql -u USERNAME -p ...
3
votes
1answer
725 views

Default Wordpress settings API data sanitization

It looks to me that when saving data to the database via the settings API Wordpress sanitizes data by default. By that I mean that if I look at the raw settings options in the database they have (at ...
3
votes
2answers
3k views

Transient RSS feeds in wp_options not removed automatically?

I just noticed 55.000 entries(!) in my wp_options table. I had not been there for a while. So I ran: delete from `wp_options` where `option_name` like '_transient_timeout_rss%' delete from ...
3
votes
2answers
705 views

Display data from a non wordpress database on a page template

I am using a sql query to access information to display on a wordpress page by adding the below code to a page template. I know the query works as I've tested it in phpmyadmin. $rows = ...
3
votes
1answer
120 views

what is the wp_5_posts table in the database?

I'm wondering what all the wp_2_*, wp_3_*, wp_4_*, and wp_5_* tables are in the database. Does anyone know what they are? Some of them in my example are from plugins, but what does the wp_# prefix ...
3
votes
2answers
1k views

Is it a bad practice to go directly to the mysql database while developing a plugin?

This is a sample of the Vote it Up plugin: //Run this to create an entry for a post in the voting system. Will check if the post exists. If it doesn't, it will create an entry. function ...
3
votes
1answer
469 views

$wpdb->prepare() warning in WordPress 3.5

I am receiving this warning when I try to run a database query: Warning: Missing argument 2 for wpdb::prepare() The offending query is: $result = $wpdb->get_var( $wpdb->prepare( ...
3
votes
1answer
3k views

how do I determine which image is the featured image in the database

I've queried all children of the post, and two records are shown. This is ok because there are 2 images in the gallery, but I can see no field in the database which makes it clear which one is the ...
3
votes
2answers
3k views

How to delete outdated, wrongly sized images in _wp_attachment_metadata?

I've got several custom image sizes for my blog. One of these is setup as add_image_size( 'slide', 640, 290, true );. These are used in a header slideshow. My problem is I've upped the dimensions of ...
3
votes
2answers
2k views

Displaying content from one WP site on separate WP site

I have two totally separate WP websites setup. Different domains, different databases. I manage both of them and they are both hosted on a dedicated server. I am trying to include some basic ...
3
votes
2answers
1k views

How to change option recently_edited?

WP recently_edited option can be very useful - it tracks last 5 files that you've made changes to. Only problem is - well, that's all, 5 files. What if I've been made numerous changes to Wordpress ...
3
votes
2answers
825 views

Custom Post Type with Input fields to seperate table on database.

At the moment I'm using a custom post type called 'locations' I would like to be able to put input fields into the custom post type that would store the information such as ( address, type, phone ...
3
votes
2answers
350 views

Sharing database for collaborative development

Is there a straightforward way to share/sync multiple WP instances with a single database? I work collaboratively with several developers on custom themed sites. We use git to keep our files in order ...
3
votes
1answer
85 views

Can I explicitly specify ENGINE=InnoDB in Wordpress?

I converted all my tables to InnoDB, but the MySQL server (which I can't access, as I'm on shared hosting) has MyISAM as the default, so every new table that Wordpress creates (e.g. when I add a new ...
3
votes
2answers
612 views

WordPress use innodb by default?

I just created a new WordPress site in my server. Normally, WordPress uses MyISAM as the database type. But this time, it created all InnoDB tables! Is this normal? Has WordPress switched to InnoDB in ...
3
votes
2answers
6k views

Connect to database using wordpress wp-config file

How can I connect to the database using the wp-config.php file ? I'm trying to make a script more Wordpress friendly, and I need to connect to the database, but without installing the script as a ...
3
votes
4answers
444 views

How many users can WordPress handle?

I want to design a member login site in WP but I have a doubt that is WordPress can handle more than 40000 users on same database? I am not sure about this so I am stooping my work here. So please ...
3
votes
1answer
282 views

Writing a plugin that notify my friends of new post that mentions(@) them

For example, I write a new post with content "Today I'm happy, because I finally met the girl that @David told me about bla blah..." Once the post is published, there should be an email notification ...
3
votes
1answer
217 views

How is custom menu hierarchy output handled?

I'm looking to pass custom nav_menus through an RSS feed so I can grab them on other sites to create the same custom menu on multiple sites. What I can't figure out by looking through the database is ...
3
votes
1answer
238 views

What is the advantage of separating wp_users and wp_usermeta table?

I want to know why Wordpress designed their database with two tables separating users and meta from each other. Wouldn't it be better if first_name, last_name, nickname, description, and capabilities ...
3
votes
2answers
87 views

Wordpress will not operate correctly

My website is ImASpy.com. If you click on the link, Findings, this takes you to my first Wordpress page. It appears to work fine until you click on comments, or you try to go to the about page, which ...
3
votes
1answer
959 views

importing data from non-wordpress mysql db

I have created an import file to get the articles from a non-wordpress db and bring them in as posts in wordpress, I am not sure how to bring over the thumbnail image into my custom field I defined as ...
3
votes
1answer
191 views

Custom post type or just use custom fields

I am turning a restaurants website into a wordpress website to allow for the customer to take over content changes. The restaurant has a menu that has categories like Baskets with different types. For ...
3
votes
1answer
185 views

Plugin Not Working, But Only On GoDaddy Hosted site

I'm creating a plugin for a friend to log search terms on his site. It's very basic. It creates a new table to store terms entered in the search box. It converts the search term to lower case, ...
3
votes
1answer
579 views

Wordpress admin never finishes saving page on site with large page count

I have a Wordpress install with a very large amount of pages (a few hundred thousand), and over time it has gotten to the point where editing a page takes an extremely long amount of time. It would ...
3
votes
1answer
295 views

BuddyPress: What's the use of wp_bp_xprofile_data table and how does it get updated?

I have a questions related to BuddyPress: What's the use of wp_bp_xprofile_data table? How does the data in the table get updated? And when any user updates his information - does the data in this ...
3
votes
2answers
325 views

Custom database or Custom Post Types?

I have been searching throughout the web for the best way to implement what I need but just cannot find a best solution as there always seems to be some drawback. I'd prefer to do it right the first ...
3
votes
2answers
363 views

How to delete custom field “suggestions” from dropdown list

When you use a standard custom field in WP you have to write the name of the cusotm fields the first time. The second time you use a custom field it sticks to the custom fields dropdown list. But, ...
3
votes
1answer
275 views

Showing content from another wordpress installation database in the page template loop?

I am just wondering if it is possible to show just the page content of another wordpress database on wordpress pages with the same pageID within the content loop in my page template. To be more ...
3
votes
1answer
181 views

Should I use Transients with W3 Total Cache APC Caching?

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" ) ) { ...
3
votes
1answer
216 views

How to use custom database tables for custom post types?

I need to use an existing database table as a Custom Post Type (CPT) to integrate it with wordpress. I've considered @boone-gorges thoughts here (should I?) and have decided, Yes, I need to use a ...
3
votes
1answer
981 views

How to convert regular categories to custom taxonomy?

I have a big list of categories/subcategories (around 60 in all). It now makes sense that instead of these categories being available to any post type's category list, these categories should be moved ...
3
votes
2answers
795 views

remove missing image attachments

Best way to programatically remove attachments that are missing images? I ask because after using a caching plugin, I have images that have been input in the database as attachments that don't ...
3
votes
1answer
1k views

Not sure the best way to save custom plugin data

Doing my first plugin with 3.1 Everything is great, but I need to store the data now. My data is sufficiently complex that it requires custom tables (as opposed to options). So now I am wondering ...