The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [database]

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

687 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
8
votes
1answer
544 views

comment_post_ID 0 (cannot remove from dashboard)

Ran across something a bit odd that I haven't seen before. A client has a pretty active blog and uses Akismet (paid) to protect against spam. At least once a day, they're reporting a spam comment that ...
5
votes
1answer
108 views

How to track user progress?

I'm looking to build a very lightweight learning management system of sorts. I'll have 2 custom post types "Course" and "Lesson". I will associate the Lessons to the Courses, probably by using the ...
5
votes
2answers
5k views

How to stop WordPress using utf8mb4_unicode_520_ci collation?

Recently I've installed PHP7 on my MAMP and updated to newest version of WordPress. Every time I do a new site all my tables are using collation utf8mb4_unicode_520_ci I have tried setting define('...
4
votes
1answer
3k views

Add indexing to meta_value in wp_postmeta

Is it poossible to add index to the meta_value column in the wp_postmeta table in order to make faster queries in Wordpress? I have about 5 million rows in the wp_postmeta table and my queries takes ...
4
votes
1answer
50 views

Importing users from one database to another and saving passwords

I have been trying to formulate a way to take a database SQL file of users from one database and add it to another WordPress database while saving the old WordPress site passwords on the new WordPress ...
4
votes
1answer
58 views

Getting wrong relationship value in $args in wp_Query?

I am trying to fetch data from the database for my custom plugin and post type. my query arguments should be like: $args = array( 'post_type' => 'products', 'post_status'=> 'publish', ...
4
votes
0answers
256 views

WP-CLI methods for get_current_blog_id, get_blog_details or $wpdb->prefix

I'm looking for some extra information about an mu site (--url) when attempting to export from a remote server to my local testing environment. One requirement for migration is the existing blog_id ...
4
votes
3answers
3k views

Ways of managing staging and production wordpress sites?

Ok, I've seen a lot of similar questions.. but they all either outdated or do not fall in in my problem. So the problem is: We have a website and its clone stage website. On that website, apart from ...
4
votes
2answers
875 views

WP_Options ID high

I have a site where the options_id field in the wp_options table has grown very, very large. A month and a half after the installation, the auto_increment value is now at over 10 million. While ...
4
votes
3answers
217 views

Uploading/Deploying a Multi Site Install

So I was looking to create a multi site for a clients since the goal is to have the same branded theme on several sub domains to deal with different countries (e.g. mysite.com, usa.mysite.com, canada....
3
votes
1answer
425 views

Strange characters on wordpress site - Not UTF8 Issue

I've imported WordPress post data onto a new site and noticed I have strange characters showing on pages and Blog posts. It usually shows where apostrophes should be. I've searched multiple ...
3
votes
1answer
25 views

Suggestions for WPMU Migration (advanced)

We have a multisite network with a few hundred sites. We are currently merging with another company and migrating our sites. However we have a few clients who have decided to jump ship and are asking ...
3
votes
1answer
852 views

How to Join two tables from separate databases within Wordpress

Using wpdb to connect to a separate database I have connected to my other database with this code $mydb = new wpdb('username','password','database','localhost'); Now I need to do a Join of a table ...
3
votes
0answers
235 views

Should I hint table index for search query on wp_post

I'm currently inspecting a WordPress setup with multiple custom post types that should be included into search results. The database query for a search after the word Search looks like this: SELECT ...
3
votes
0answers
2k views

Connect to live db whilst working locally

Please excuse my ignorance, as I'm entirely self taught (HTML, CSS, and some JS and PHP) as a hobby, and SSH is all fairly new to me. I originally built a static website for my wife's childminding ...
3
votes
1answer
1k views

How to merge local and live databases?

We've been developing for Wordpress for several years and whilst our workflow has been upgraded at several points there's one thing that we've never solved... merging a local Wordpress database with a ...
3
votes
1answer
1k views

How to track a users progress through pages by inserting data into Wordpress Database?

My website users can learn British Sign Language through Video Tuts, Quizzes and games etc. I would like to track the users progress through the pages of the course and add that data to a Wordpress ...
2
votes
0answers
139 views

Exporting revisions

How do you export revisions for posts? I cloned a site with it's complete Wordpress DB 4 months ago. After the clone revisions have been made to the existing posts and new posts has been added to ...
2
votes
0answers
719 views

How to merge two WordPress databases with the same structure?

I have two WordPress sites with the same database structure (same prefix, number of tables etc.). Now I want to merge all data from the two databases to make it one single database. How can I do that?...
2
votes
1answer
59 views

Developing Wordpress on Kubernetes

I'm currently researching how to develop a Wordpress site on top of Kubernetes. I would like to be able to develop Wordpress sites while the live site is running in production. However this would ...
2
votes
0answers
122 views

Emojis getting converted to “?”

Emojis in posts and comments on a 500+ posts blog get converted automatically into single question marks in irregular and untraceable intervals. The respective tables wp_comments and wp_posts are ...
2
votes
1answer
59 views

Building a Scalable Resiliant WP Setup

This my first post so Hi all, I'm not new to IT and Linux but I'm new to running WP at scale and was hoping for some advice or insights. I have customer who has a business that is starting to scale ...
2
votes
0answers
75 views

Trigger Plugin database update after git pull

I have a couple of WordPress websites that I'm maintaining. The websites are on various git repositories (one for each site) with individual remotes. Currently when there is a plugin update ...
2
votes
1answer
611 views

Wordpress showing install screen after max_questions error

I am working in a PHO environment in Heroku with ClearDB. At some point (really low), I get this error: WordPress database error User 'XX' has exceeded the 'max_questions' resource (current value: ...
2
votes
1answer
54 views

Which is best in the following scenario : post_meta vs custom table vs parent/child posts

I’m looking for a bit of advice on which way to go with a development question. I’m building a community site where subscribers create their own private posts. The data they enter falls into two ...
2
votes
1answer
423 views

DB_COLLATE not working on fresh install

I always knew that WordPress uses utf8_general_ci as tables collation, but recently it keeps installing utf8mb4_unicode_520_ci. What I do is: Download WordPress from wordpress.org Rename wp-config-...
2
votes
0answers
147 views

Is the usage of ON DELETE CASCADE wrong or not allowed on wordpress?

I have table with foreign key reference and i recently changed the create table query with ON DELETE CASCADE $wpdb->query("DROP TABLE IF EXISTS $table_name2"); //CREATE TABLE ...
2
votes
1answer
24 views

How to prevent Wordpress from retrieving data for the last 10 posts in the database?

According to the Query Monitor plugin, Wordpress is calling four queries for the last 10 posts in the database, starting with this to know the IDs: SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM ...
2
votes
0answers
212 views

Emoji support and MariaDB 10.0.30-

I am using Wordpress 4.7.3 with the built in Emojii support. We have recently moved to MariaDB 10.0.30, but the original wp-config indicates define('DB_CHARSET', 'utf8). I have noticed that I cannot ...
2
votes
1answer
97 views

Recommended custom post type structure for TV Schedule site?

I'm working on a from-scratch rebuild of a site for a TV network that has a fairly large amount of content (~50 Shows, ~3000 Episodes, ~300 Movies, ongoing schedule entries, etc.). We want to be able ...
2
votes
0answers
62 views

Remove obsolete plugins artifacts from database tables

I'm dealing with some long-running WordPress blog. It was moved to different servers several times, and the migration process haven't followed «the WordPress way» from time to time — just a database ...
2
votes
0answers
1k views

Database with mixed collation (utf8mb4 & utf8_general_ci)

Each time I was uploading my WP install from offline to online, I was noticing strange characters in text and digging a bit I have discovered that wp-config.php on the online server was set to define('...
2
votes
1answer
51 views

Change setting name in Customizer and keep the data

I created a theme while back when I was new to Customizer API and for some weird reasons I named theme settings as: $wp_customize->add_setting('thefunk_theme_options[header_color] Instead of just ...
2
votes
1answer
418 views

error establishing a database connection

I know this question is asked like a million times, but I can't find an answer for my problem. This problem is happening in a user of my server (my father's blog actually), and as he told me: "Just ...
2
votes
1answer
43 views

Should I be able to run two different “close” code versions of wordpress with the same DB

A concrete example - I am upgrading to 4.1 from 4.0, the upgrade was successful but I discovered that a plugin broke. Can I just revert the code. The real live issue I am facing is having two ...
2
votes
1answer
49 views

How to migrate the posts from an old custom legacy blog to a new WordPress website?

I have to migrate the posts of a very old custom legacy blog made in ASP (the posts are stored in a MySql table) into a new WordPress blog. So I need your help to find the smartest solution to do it, ...
2
votes
0answers
919 views

Easiest Way to Authenticate WP Users Using an External DB?

I have been looking for the best/easiest way to share users on a WP blog (in a subfolder) with the MAIN site's user database so that people do not have to register/log in on the WP blog when already ...
1
vote
1answer
30 views

wp_options is GB in size

How can I find what options or plugins are taking up all that size? It's not transients because after deleting all it's still 13GB. SELECT option_name, option_value FROM hihgv_options WHERE autoload =...
1
vote
0answers
26 views

Updating Woocommerce Settings API when Wordpress Settings API saved and vise versa

Working on a woocommerce gateway and i am trying to make it in such a way that when users saved changes on the woocommerce payment gateway settings page, some values are updated in the admin setting ...
1
vote
2answers
441 views

Get url of product's images (woocommerce)

What happen when a post (product) didnt have a guid,because it has the same image with another product ? For example: Query1: select guid from wp_posts where post_type='attachment' and ...
1
vote
0answers
129 views

Is it safe to convert tables from MyISAM to InnoDB?

I have inherited a WP site (with WP5.1 and WooCommerce 2.6.14, LearnDash 2.5.4 and few other smaller plugins). From screenshot you can see that it is a mix and match of MyISAM and InnoDB tables. ...
1
vote
1answer
13 views

How can I perform high-level database merging for WordPress within continues delivery?

I've a bit of a problem. I'm currently trying to realize a WordPress development process regarding to one of my old question / topic: https://stackoverflow.com/questions/48890019/wordpress-...
1
vote
1answer
21 views

Is there a smart way to obtain a list of only some selected user meta data?

I have a case where, if I had written the DB and queries myself, I would just do something like SELECT name, firstname, email FROM users WHERE .... Returning me a list/collection/array, I mean, not ...
1
vote
0answers
36 views

Why does importing copies of the database dump and the document root make WordPress data inconsistent?

I'm experiencing the following problem: I have a local copy of my WordPress site and a corresponding live version on my server. I added some new blog categories on my local version and created some ...
1
vote
0answers
30 views

How can i customize the export personal data file?

I want to know is there a way to customize the export personal data page? If you go to wp dashboard > tools > export personal data, you can download an html file which contains your personal data. Is ...
1
vote
0answers
169 views

Your PHP installation appears to be missing the MySQL extension which is required by WordPress

I have no problems using the dashboard, viewing plugins, etc. but when I try to view the front end I get Your PHP installation appears to be missing the MySQL extension which is required by ...
1
vote
0answers
51 views

Delete query not working in plugin

<?php if(isset($_POST['deleteValues'])){ global $wpdb; $table = $wpdb->prefix . 'addkeywords'; $where = array( 'id' => $id); ...
1
vote
0answers
22 views

I got an issue after i migrated a site

I recently migrated a site to a larger server. Everything appears to be fine, the site works everything transferred over. The site does have an SSL cert. Recently we started to get flagged as unsafe ...
1
vote
1answer
97 views

change wp user status from wp_users table

The wp_users table doesn't seem to change when I change a user role from editor to administrator via phpmyadmin when I edit it. Where is the user's role stored in the WP database? Any clues?
1
vote
0answers
62 views

how to solve slow WordPress site caused by attachment_metadata

My WordPress sites starting to become slower by time, after two years they become very slow. I tried many things, such as: improved my DB, used cache plugins (WP Rocket and W3 Total Cache) which both ...