Skip to main content

Questions tagged [mysql]

MySQL is an open-source, relational database management system.

Filter by
Sorted by
Tagged with
0 votes
0 answers
4 views

Global update of records after import WP All Import Pro

friends. I have encountered a problem updating records. I am importing vacancies into the WP Job Board Pro plugin via the WP All Import Pro plugin. When importing, I have a field in wp_postmeta ...
Givanni Dev's user avatar
0 votes
0 answers
8 views

Remove posts that start with similar words (like a delete duplicate posts plugin)

Can anyone advise on a SQL query or plugin (or any other solution, as I haven't been able to find any) that can delete all posts that start with the same words, except the oldest of them? Or maybe to ...
Johnny Bravo's user avatar
0 votes
0 answers
27 views

$wpdb->get_results() query empty, but same query in phpmyadmin has results

I'm running the following query to get attachment data for a long list of post ids: SELECT post_id, post_title, meta_key, meta_value FROM wp_postmeta JOIN wp_posts ON wp_postmeta.post_id = wp_posts.ID ...
Matt Dietsche's user avatar
0 votes
1 answer
25 views

mysql running over 200% CPU according to atop - pt-query-digest suggests slow running query is a lookup in wp_options for 'autoload' = yes

I've been having some problems on my wordpress site recently whereby it seems to become unavailable intraday requiring a reboot of the server. Prior to this I'd been seeing high CPU alerts showing ...
Phill Ash's user avatar
  • 101
0 votes
0 answers
17 views

select posts from sql except posts from specific category

I have a a query to get post ids of a category // get ids of posts that belongs to category with id=202 <?php $args = array( 'showposts' => -1, 'category' => 202, 'post_type' => 'post'); $...
ehsan's user avatar
  • 13
0 votes
0 answers
21 views

Wordpress cannot detect (present, loaded) mysqli

I am setting up a small integration that is an off-WP cronjob to export some post data and send them to Google Drive. System works perfectly on DEV server. On production, no matter what, the log file ...
7fc9ecfc6810c58545e1bc3b556003's user avatar
0 votes
0 answers
30 views

is it possible to get a list of URLs from post_content directly in a mysql query via phpadmin?

We have many forms that are hosted externally from our Wordpress environment that we are moving to a different system, so we'd like to generate a list of the pages that contain these links along with ...
Erich's user avatar
  • 1
0 votes
0 answers
37 views

Admin backend is very slow to create or edit posts by core meta query

Over the last few weeks, I've noticed that my website's backend has been getting extremely slow, and today it has come to a complete crawl. I installed the Query Monitor and found that this WP core ...
Keith Mitchell's user avatar
0 votes
1 answer
29 views

Do Seeded Orderby Rand Queries Benefit from DB Caching?

I'm aware that various object caching plugins give you the benefit of caching results from frequent database queries. So that repeated queries return a cached result set rather than running the query ...
RodneyUK's user avatar
0 votes
0 answers
26 views

WP_Query does not return the result even if the data is present in the database

I have a plugin that has following code $posts = new WP_Query([ 'post_type' => 'campaign', 'meta_query' => [ 'relation' => 'AND', ...
Praneetha's user avatar
  • 103
1 vote
1 answer
99 views

Disable creating sort index SELECT post_modified_gmt

strangely my theme doesn't have the function that generates queries like this SELECT post_modified_gmt FROM wp_posts WHERE post_status = 'publish' AND post_type IN ('post', 'page', 'attachment') ORDER ...
Công Tử Huyết's user avatar
1 vote
1 answer
59 views

Deleting WordPress posts and media files based on author via MYSQL database

I would like to delete some of the posts in WordPress between a period based on the author via MYSQL database. I have difficulty identifying the WordPress tables and their relationships to perform the ...
Lal Prasanth's user avatar
0 votes
1 answer
70 views

How to generate PDF dynamically based on values from the database in WordPress

How to generate PDF by using the values from database without using plugin in WordPress. For example, I have a form and will enter the Name. Then it needs to fetch the data from DB based on the ...
Manikandan's user avatar
0 votes
0 answers
36 views

To many WooCommmerce related transients in WordPress options table

I have the following problem on my Wordpress installation. There are too many, hundreds to thousands of transients in the options table. And the options table grows and grows and grows. If I don't ...
ossicom's user avatar
0 votes
0 answers
74 views

SELECT option_name, option_value FROM wp_options WHERE autoload = 'yes' always is running

I'm using wordpress on a VPS cpu 20 core ram 20 but my cpu and VIRT always is high! I checking mysql database, I found out this query is always running: SELECT option_name, option_value FROM ...
user254039's user avatar
1 vote
0 answers
36 views

How to properly prepare a column name if passed to a stored procedure?

I've figured out that I can use %i with $wpd->prepare() to escape identifiers like column names. The thing is that the query I'm preparing is a call to a stored procedure like this. I want the end ...
Compjeuter's user avatar
0 votes
1 answer
36 views

Updates applied to staging WordPress site affecting production even with different databases

I am experiencing strange database-related behaviours on my server that hosts a few versions of the same website. The problem relates to making content and theme updates to one of the subdomain sites ...
Mike Hermary's user avatar
0 votes
0 answers
9 views

Custom API how to return int field

I have a custom table in db with a column recommendation of type int(11). Then as one of my custom route handlers I have global $wpdb; $query = "SELECT recommendation FROM `restaurants`; // ...
Simon H's user avatar
  • 335
0 votes
1 answer
31 views

After Import: Insert "Use" Statement in Database

In transferring a site from one host to another while retaining the same domain name, copying WP files is straight-forward, not so with sql databases. In a shared hosting environment, importing a ...
Laurie Stearn's user avatar
0 votes
1 answer
57 views

Understanding Redundant postmeta Tables in WordPress Database

I have noticed that my WordPress database contains three identical postmeta tables. Each of these tables seems to hold the same information. Is it normal to have multiple postmeta tables in a ...
Diane Rendel's user avatar
0 votes
0 answers
47 views

Help with creating commenting system using PHP, jQuery and AJAX

I am working on creating a comment system for an events plugin I am working on. I've got the main comments working fine with them saving to the database and displaying on the page. What I need help ...
Darth Mikey D's user avatar
0 votes
0 answers
95 views

Product reviews in my sql database

Apparently product reviews section within woocommerce does not have any option to adjust the amount of reviews displayed per page under screen options? Unlike the products section. Is there a way to ...
Jason's user avatar
  • 1
0 votes
1 answer
455 views

#1067 - Invalid default value for 'post_date' when trying to create a new column

I am trying to create a new column inside the wp_posts table but I am getting the error #1067 - Invalid default value for 'post_date' when I try and save it. What I am trying to do is, I am getting ...
I. Antonov's user avatar
0 votes
0 answers
44 views

MySQL has died. How do I recover? SOLVED

Not sure if I'm asking this in the right place. If not the right place please suggest where I may ask this. I'm usually on stackoverflow. I noticed my websites could not communicate with mysql today. ...
Trev's user avatar
  • 101
2 votes
3 answers
63 views

WP Plugin: How to avoid db access for each comment?

I'm writing a WP plugin which enables voting for comments. To store the votes a custom db table wp_comment_vote is being used. CREATE TABLE wp_comment_vote ( comment_vote_id bigint(20) UNSIGNED ...
Abid's user avatar
  • 143
0 votes
0 answers
33 views

Updating wp_postmeta from meta_keys and meta_values from another table having price and sku only

UPDATE wp_postmeta pm INNER JOIN wp_postmeta as pm2 on pm.post_id = pm2.post_id SET pm.meta_value = 'price such as 45' WHERE pm.meta_key = '_price' AND pm2.meta_key = '_sku' AND pm2.meta_value = '...
Syed Bilal Ali's user avatar
0 votes
0 answers
28 views

Does Wordpress work with MySQL active-active GTID-Based Replication without any issues?

Does WordPress work with MySQL active-active GTID-Based Replication without any issues? Is it suitable for the production WordPress website? I would like to set up the same with WordPress 6.2.2 and ...
PJ DevOps's user avatar
0 votes
1 answer
22 views

Query custom fields with three dates - start and end does not work

I have tried to make a reservation system for a book a table in restaurant. But, I have a problem when I try to see/ make new reservations in an specific day - in showing me which table are free at ...
Fujitsu09's user avatar
0 votes
0 answers
319 views

WP-CLI PHP Deprecated Warning

Under WordPress 6.3, PHP 8.2, MySQL 8.0.34, WP-CLI 2.8.1, for wp command like this: wp post list --post__in=mypostid I have this warning: Deprecated: Creation of dynamic property Post_Command::$...
Brethlosze's user avatar
0 votes
0 answers
48 views

Import posts from a different database with the same old id

I am trying to retrieve data from an old custom programming to a new WordPress site, but I encountered a problem that I cannot retrieve the old id number. I need that to keep the site's archive, the ...
Kami's user avatar
  • 1
1 vote
0 answers
107 views

How connection pooling can be implemented in Wordpress?

I have been facing issues with High connection count on mysql DB and therefore suggested to have connection pooling implementation. I did a lot of research but finding solution for different tech like ...
Prashant Dubey's user avatar
0 votes
1 answer
68 views

Multisite: merging two subsites in the main site

I have a multisite: example.com = example.com/ar/ example.com/es/ example.com/en/ example.com/ba/ I need to merge 2 and 4 into 1 the main site without losing the post Ending with only 2 webs: the main ...
Irene's user avatar
  • 23
-1 votes
1 answer
108 views

MariaDB version not recognised

Getting the following error on a CentOS 9 server: You cannot install because WordPress 6.0 requires MySQL version 5.0 or higher. You are running version . So it doesn't appear to be picking up the ...
SCMedia's user avatar
0 votes
0 answers
142 views

WordPress install on new server not recognising MariaDB version

Getting the following error on A CentOS server: You cannot install because WordPress 6.0 requires MySQL version 5.0 or higher. You are running version . So it doesn't appear to be picking up the ...
SCMedia's user avatar
0 votes
2 answers
436 views

How to reduce uncached page generation time?

On uncached pages, I have been able to bring down database query timinings to less than 0.2 seconds with sql tuning. However, the page generation time is still around 2 seconds as seen below via query ...
dc09's user avatar
  • 195
0 votes
2 answers
265 views

How can I update a value of a field depending on outside source?

Say I have a text file or JSON file elsewhere on my domain, that have a simple value, like "yes" or "no". I would like to update a custom field in a database table in Wordpress (...
Malachi's user avatar
  • 101
0 votes
1 answer
573 views

running an existing Wordpress site from Visual Studio Code?

Perhaps I am being a bit thick on my research and haven't nailed what I have to do in order to achieve what I want to achieve so here's my question: I have an existing Wordpress site that has been ...
Jose's user avatar
  • 1
0 votes
0 answers
31 views

Putting form result in my database

i have a problem with my wordpress rn. I did a form in html and js, and i want to put the actual result in my database where i created a table for it. So basically i did a plugin in simple php that ...
Louis-Emmanuel Metan's user avatar
1 vote
1 answer
508 views

Batch Replace URLs in Wordpress Database

I will be using this command with WP-CLI to batch change about 1,000 URLs. while IFS=, read orig new; do wp --dry-run --skip-themes --skip-plugins search-replace "$orig" "$new" ...
JoaMika's user avatar
  • 688
0 votes
0 answers
44 views

WordPress issue - data is not showing in wp-admin, but when searching through database, all the data is there

I did a couple of plugin updates, and simple updates and it caused a site crash. I was able to deal with the plugin and get back into WP-Admin, but none of the data is there. No pages, events, ...
user231385's user avatar
0 votes
0 answers
35 views

Uploading to Wordpress Database

Hope everyone is doing great. I have a small issue with uploading information to the wordpress database. I created a new table without the prefix. I created code based on what I've learned in ...
Rookie Recruits's user avatar
0 votes
1 answer
138 views

Possible SQL injection. How to locate and fix?

Google Search Console is saying that certain suspicious URLs in my site are returning a 403 error. They look exactly like this (the links below are not my sites, just examples): https://www....
location's user avatar
0 votes
0 answers
39 views

Have Wordpress Use a Different Database for users

I have imported my users from Filemaker into a different table in Mysql. Can I have my user login to that database instead of the wp_users table. If so how do I connect it? Thanks in advance for your ...
user3753328's user avatar
1 vote
0 answers
73 views

Split Million WordPress Post's Into Multiple Database Server

Say I have 50,000 posts in my current WordPress installation. May be it will grow more than 5,00,000 post's in the future. Now I wanna Scale the database. I wanna put , 1-50,000 posts > database ...
damagebrain's user avatar
0 votes
0 answers
243 views

Too much slow queries with my multisite

I have about 450 websites on a Wordpress 5 Multisite. The db is about 2GB with 8691 tables. My server is now very slow, I think because of mysql. I also saw many slow queries like this : # Query_time: ...
Sami's user avatar
  • 174
3 votes
1 answer
595 views

How to find source of these strange SQL queries?

I'm looking at my slow queries and i don't understand how some bot or person is doing them. They look like this: (i copy/paste them no placeholders!) SELECT post_id FROM wp_postmeta, wp_posts WHERE ID ...
Michael Rogers's user avatar
0 votes
0 answers
85 views

Can running a WP-Cron to update_post_meta cause performance issues?

I'm counting post views on a custom field inside wp_postmeta, the update happens each time a user interacts with the post. I was reading at this response Will a large postmeta table slow a site down? ...
Michael Rogers's user avatar
0 votes
0 answers
155 views

Custom form that stores data in mysql database

Im currently building a website that allows a user to rent a boat rack but they need to be in the town in order to rent. I want to know how to create a form that allows the user to input their address ...
Logan's user avatar
  • 1
-1 votes
1 answer
125 views

wp_mail function not working in user query loop

I'm trying to send an e-mail to every user who is logged in more than a year ago (based on woocommerce meta value from database), but the e-mails do not go out. In my code I'm trying to filter myself ...
Attila Sotus's user avatar
0 votes
1 answer
200 views

MySQL query to list users who never signed in

What MySQL query can I use to get a list of users who have never logged in to WP? Some background... My WordPress website has been running since 2015 and initially, I had a newsletter form that would ...
Lazhar's user avatar
  • 183

1
2 3 4 5
32