Questions tagged [database]

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

779 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
6
votes
2answers
6k 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('...
5
votes
0answers
341 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 ...
5
votes
1answer
341 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, ...
4
votes
1answer
5k 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
51 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
2answers
1k 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
225 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
33 views

Prevent changing the length of post_name column on WordPress Update

We've some Arabic websites running on WordPress, and use Arabic slugs in the posts' URLs. You know that post slug is stored in the post_name column in wp_posts table, and the default length of this ...
3
votes
0answers
337 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 ...
3
votes
1answer
940 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
3answers
11k views

What causes the “max_user_connections” warning on WordPress frontend?

I'm currently getting this error in the front-end only (not inside /wp-admin): Warning: mysqli_real_connect(): (HY000/1203): User xxx already has more than 'max_user_connections' active connections in ...
3
votes
0answers
317 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
2k 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
22 views

Storing Email Account Passwords for SMTP Mailing for a WordPress Plugin

I am currently converting a client booking system I created into a WordPress plugin. It uses the PHPMailer library to send emails. I am using SMTP security to send the emails and thus need the email ...
2
votes
0answers
101 views

Make Wordpress Search for Both Main Domain and Subdomain

I have check through Stackexchange, but no topic is similar to this topic to this. Is there any way to make WordPress search work for both main site and subdomain? Both of them have two separate ...
2
votes
0answers
1k 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
133 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
257 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
134 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
90 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
1k 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
73 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
1k views

Custom DB_COLLATE (collation) value 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
228 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
28 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
240 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
119 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
66 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
2k 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
56 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
428 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
54 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
923 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
0answers
12 views

How to move the WordPress site Layout from test site to Production site?

I make the changes in the Layout of the test site, and on the other hand my production (live) site was running and people make account on that and make purchases. Now I want to transfer the test site ...
1
vote
1answer
18 views

WP All Import - Using Xpath to set a select value

I'm working on setting up an import using WP All Import, the idea is to update/add/remove posts within a custom post type which contain ACF fields. The CSV we are importing contains a column called &...
1
vote
1answer
60 views

Saving data from block editor to the database

I'm developing a wordpress plugin and looking to save data entered in a block to a mySQL table. That's it. But how can data be sent from the block editor to the server side? I've spent two weeks ...
1
vote
0answers
18 views

Updating Media Published Date When Parent Post Is Modified in Wordpress

I am hoping to make the published date of my media files always equal the modified date of the post it's attached to. e.g. Image 1 (date: 1/1/20 5:00PM) is attached to Post 1 (date: 1/1/20 5:00PM) ...
1
vote
0answers
18 views

Allow logged in users to store and display some data

I have my website in wordpress, with Ultimate member plugin installed and letting users create their own accounts. What i want to achieve is to let logged in users click on a button that creates a ...
1
vote
0answers
18 views

Prevent duplicate records in plugin table

I'm working on a plugin that keeps track of like counts on every post in the site. When the plugin is activated a custom table is created to store all the data. The plugin then checks on every page ...
1
vote
1answer
16 views

Redirecting to old domain after migration website

Could someone help me with restoring my website (with new domain name)? I have a database backup and when restore it, wordpress is redirecting me to old website and domain. I changed site url in mysql ...
1
vote
1answer
17 views

Replace/Mute/Stop Search Query

I'm trying to replace the search functionality in WP. I've already created the search.php template with all the results I want to display. I don't want any results from the WP database. I just want ...
1
vote
0answers
59 views

How does WordPress know wich language is chosen when there is a database connection error

When I have a db connection error in WordPress, WordPress shows the following error: Error establishing a database connection But when my website's language is set to german, the message shows: ...
1
vote
0answers
16 views

How to perform a heavy and long process in cron jobs?

I have a table in my database that has more than 1000 records and new records can add anytime. I run a process on every record of this table daily. I use an event scheduler to do so in WordPress. But ...
1
vote
0answers
66 views

Trying to change database tables storage engine to innodb gives error “invalid default value for 'post_date'”

I have a live WordPress website. Most of the tables are using MyISAM storage engine with UTF-8 encoding. I need to switch their storage engine to innodb. But when I try to change the engine, I get ...
1
vote
2answers
28 views

Form doesnt save to database

It is my first form trying on wordpress.I changed some names such as "name","e-mail" etc. to "name1" , "email1" etc.Because without these changing, submit button refers to 404 page. There is no any ...
1
vote
0answers
18 views

Database to page routing API?

Lets say I have in my database a table for Universities - and for each entry in the database, the primary key would be the name of the University, i.e Duke. If I created a template for all the ...

1
2 3 4 5
16