Questions tagged [database]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
22 views
+50

Menu Items disappearing/being empty on save or post edit

I've been having this weird issue on a site for a few weeks now, tried everything I found by searching but still not being able to find a clue of the issue. Whenever I add some items to the Menu (...
0
votes
0answers
16 views

multiple select statement in one query

I want to display post count chart in my page. I have to different custom post types Example: "Books" and "Videos" . the problem is that I can not display my second CPT data on the ...
1
vote
1answer
19 views

Exporting table to csv works in the admin but exports HTML data when used on the front end

I have some code, implemented by a shortcode within a custom plugin. The code generates a CSV file from some data tables. When I run the shortcode within the admin section, it works perfectly. BUT ...
1
vote
0answers
14 views

How to check if tables in Wordpress still exists after activations

I have problems that my checkIfTablesExists() function is never called, even though I add some fake table name to the list of table names. The reason I want to make this function is to check if the ...
0
votes
0answers
17 views

Real time post display on home page (as soon as they are published)

I have noticed this becoming a trend with comments and now posts. I'm sure many sites (especially community ones) will implement this. Here's exactly what I mean, click here: https://stackexchange.com/...
1
vote
2answers
23 views

Difficulty importing my live site to local

Im using local by flywheel, Here are the steps i have taken so far: Installed local by flywheel and created a site called stage Downloaded the website from CPanel and also the SQL database Imported ...
0
votes
0answers
20 views

Occasional Error Establishing a Database Connection

I have two small WooComm WP sites on Vultr and both of them work for a few days and then I get the old "Error Establishing a Database Connection" error. If I reboot the server they work ...
0
votes
1answer
20 views

Insert Custom Data into wpusers

I add custom row at my wp_users table but the data in the row such as phone_no and ic_no. But when i try to add data, the data not pass in my table This is my code <?php /* Template Name: Register *...
0
votes
0answers
14 views

How to serve a searchable database of more than a million records

I have a database that is current living in a CSV file in my local machine. That database contains around one million entries. An entry looks like the following: NAME SURNAME PLACE_OF_BIRTH ...
0
votes
0answers
18 views

Does this archive template part look like its making too many calls to the db?

I set up a custom post type & taxonomy and registered it as a plugin. Then i'm referencing it from an archive template like this: <?php /* This loop is used in the Archive [.php] template. */ ...
0
votes
1answer
17 views

$wpdb->delete not working for me

I have a function (see in full below) that syncs data into WP from an external database. It's a list of scheduled items. When the schedule is updated, old data should be deleted. See this snippet: $...
0
votes
0answers
14 views

My website is showing today's date instead of published date since db migration to a new wordpress

I exported my database and content to a new Wordpress. Everything works fine, except that every post is showing under today's date, instead of the published date like it should be (the actual ...
0
votes
0answers
11 views

A database for each category?

I thought that wp multisite was ok for my idea to have a network with separated databases but I read that the database is shared. So I wonder if there is something to have one backend and a database ...
0
votes
1answer
22 views

Is There Any Built In WP Functionality For Combining Form Fields To Return Specific Data

I have a basic job board on a site (a custom WP theme) that uses the WP search form to search by keywords in the 'jobs' custom post type, and users can also click on job categories which I have listed ...
0
votes
1answer
20 views

How do I add a medium to the Wordpress database with my own plugin?

I wrote a plugin that accepts files via Wordpress and saves them outside of the server. Now I would like to save the metadata as normal in Wordpress, as if the file were on the server. Is there a hook ...
0
votes
0answers
22 views

Sql query to get all metadata for a post

I have three tables in my database one is users table the other is posts and wp_post meta. In the user table I have all the user details . In the wp_posts table I have different posts types . I want ...
0
votes
0answers
6 views

Recovery - Restore Database after moving folder location locally

I made a bit of an error over the weekend. I moved the local installation of XAMPP and subsequently broke my entire local dev Wordpress install. I have all of the folders intact from XAMPP including ...
0
votes
1answer
15 views

Is it safe to have 2 mysql users?

we have a WooCommerce website and it has a single database. In wp-config.php I setup the connection to the database: user1 name_of_db psw_for_db_user We have an ERP software installed on our office ...
0
votes
0answers
20 views

How optimize website for massive MySQL writing?

I have a website that using plugin RSS Feed Post Generator and there are hundreds post publishing in hours and the MySQL database is busy every time and it cause to heavy loading for main page and ...
1
vote
0answers
11 views

How to replicate a user plugin made table value, to this user's custom meta table value?

I have a plugin that gets a value on user register and stores it in its own automatic made table. I need to set that same value into a usermeta custom meta_value, so the user will be able to see it ...
1
vote
0answers
8 views

how to oauth1 Wp plug-in revoke/reset.?

Am using this plugin to gives access to a app-backend dashboard for android/iOS apps. I authorized it and every thing was fine but apps were not working so for troubleshooting I generated another ...
0
votes
2answers
16 views

Which data is written and stored in the database when read-only (non-posting, non-commenting) users visit the site?

With a default Wordpress install, with no plugin installed, does the read-only visiting of the website generates write operations in the database? By read-only, I mean: visitors come and don't post ...
0
votes
1answer
18 views

Two prefixes in database? Which one is valid?

I am trying to manually migrate an install and have come across this. My DB has some qfo_ prefixed rows and some wpaq_ prefixed rows. The qfo_ are all duplicates of the others (in other words, there ...
0
votes
0answers
20 views

Migrate Users From laravel to wordpress

we used Laravel before , and now we are moving to Wordpress, so we need to migrate all users including the passwords , is this possible? thanks
0
votes
0answers
13 views

Showing logged in user data on the front end

I see there are quite a few answers surrounding this topic, but I can't seem to understand any of them, I am a complete noob when it comes to databases etc. What kind of code do I need if I want to ...
0
votes
1answer
9 views

How to restore an option_value with serialized data from backup data

After changing http to https in several option_values I lost page content. So I reverted the site url back to http and tried to replace an option_value in the wp_options table with data from a recent ...
0
votes
0answers
21 views

WordPress MySQL update

Help me correct this code. public function new_product($product = array()) { if ($product['product_name'] == '') return; global $wpdb; $table_name = $wpdb->prefix . '...
0
votes
0answers
32 views

how to display product price if equal to the value of another query

i want to show the prices of WooCommerce products on my site if the current product ID was equal to the product ID from another query from wp database To better understand my question please see the ...
0
votes
1answer
44 views

Using AND and bracket grouping in SQL not working

I am trying to combine two conditions in a query but it isn't working. but running the conditions independently works. LEt me explain. When I run this query: SELECT DISTINCT SQL_CALC_FOUND_ROWS ...
0
votes
0answers
25 views

Wordpress update databse table

Can anyone explain to me wpdb update database I would like to understand about $where (an array of field name). $table The table name. $data A PHP array where the keys are the columns and the values ...
3
votes
0answers
66 views

Insert custom data to custom table on wordpress database

i need some help here i wanna create some form for user to subscribe our article and store the data to database. i have tried to search it on google, but nothing worked when i tried that. i know that ...
0
votes
1answer
23 views

Realtime database update from 3rd party apps (notion, airtable, sheet, etc)

Can I achieve Realtime database update from spreadsheet? My requirements: I have many posts with custom fields that have certain values. I have all these values stored on a spreadsheet (GoogleSheets, ...
0
votes
0answers
10 views

Collecting data in RafflePress

I'm new to WordPress and I'm using RafflePress to run a giveaway to collect information for marketing, things like first and last name, phone number, and email. How would I be able to collect the data ...
0
votes
1answer
21 views

Join Query on WP_USERMETA Table

I want to check if user time zone is perth and its belong from Group A. MY QUERY IS NOT WORKING SELECT * FROM `wp_users` AS t1 LEFT JOIN wp_usermeta AS t2 ON t1.ID=t2.user_id WHERE t2.meta_key='...
0
votes
1answer
21 views

WordPress has been updated! Before we send you on your way, we have to update your database to the newest version

whenever I attempt to access our production admin panel I get the message below. "Database Update Required WordPress has been updated! Before we send you on your way, we have to update your ...
0
votes
0answers
12 views

How to get the same post_meta-field (custom field) for several different posts, with one database-call

I have the ID of a lot of different posts (50+). And I would like to get the custom field by the name: custom_excerpt for all of these posts, with a single database call. How do I do that? I'm using ...
0
votes
1answer
19 views

Upload media only to DB

I'm using the latest WordPress (5.6) and from what I've found out there's no visible setting for uploading media directly to a DB. Is there such an option somewhere hidden or does WordPress not ...
0
votes
1answer
37 views

Why last row deleted when refresh page

when I refresh page table row deleted and last query deleted when I click on any delete button of other row. Why is this happened? this is table which I displayed <?php ...
0
votes
0answers
14 views

WordPress MySQL update DB multiple columns by relationship key

Hello guys. I am trying to figure out how can I update the values of a database's columns with a relational key by passing an array of IDs (relational key), here is my code so far protected function ...
0
votes
1answer
19 views

Some weird users in database

I've noticed that I have some users that seem fraudulent in my database (in the wp_users column). And the curious thing is that they don't appear in the users list in the admin panel. How could this ...
0
votes
1answer
15 views

Delete post revisions only for a single post

How to delete post revisions only for a specific post identified by its ID using an SQL query?
0
votes
2answers
188 views

Replacing javascript link in Wordpress database without getting mysql syntax errors

After a malware attack I am trying to replace a malicious call entries. I keep getting syntax errors due to the configuration of the link. Tried all of the various escape characters to now avail. ...
0
votes
0answers
12 views

Add a row to other database from table with button

How do I get the add button to work? When I click it I want to get the user from 'User List' to the admin table instead of typing the name and email in myself (that works). But I can't get the add ...
0
votes
0answers
35 views

Save media files (images) to database instead of the filesystem

I have an out-of-the-box installation of WordPress with WooCommerce. I see that uploaded images (e.g. when I create a product) are saved in the filesystem under wp-content/uploads/. I would like the ...
2
votes
1answer
145 views

Should close $wpdb via $wpdb->close()

I’ve been writing a few custom plugins for my site and I was wondering about the correct way to interact with $wpdb. My plugin executes a few queries using the global $wpdb connection. I noticed that ...
0
votes
0answers
16 views

Changing the defaults for the _posts table, risky?

I am trying to convert my table type from MyISAM to InnoDb. the _posts table uses zero in date defaults in columns such as post modification date etc instead of NULL. This is an issue in MYSQL 8. Has ...
0
votes
0answers
9 views

How to provide a REST API for all tables, including additional tables by plugins, quickly?

Is there any way (plugin / project / etc.) to provide a REST API for all tables in WordPress, including those tables that are created by additional plugins? I had the idea to use a headless CMS like ...
0
votes
0answers
23 views

Optimise wordpress database using SQL after deleting registered images from Media Folder

I have used Media Cleaner Pro Plugin to clean few batches of registered images. Additionally i have updated my functions.php so these unused images will not be generated in future. function ...
1
vote
1answer
64 views

why update and delete query not worked in custom table?

this is custom template. I wrote crud by using wordpress query to sent data in custom table of database and get from database, insert query worked, but update and delete query not working. Below I ...
0
votes
1answer
15 views

$wpdb->get_results($wpdb->prepare(… You have an error in your SQL syntax;

I am making a database request in wordpress to make this question: select * from tc_chat_clt; How ever a error appears, what am I doing wrong? $users = $wpdb->get_results($wpdb->prepare('SELECT *...

1
2 3 4 5
48