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
0 answers
8 views

Multiple duplicate SELECT queries originating from wp_load_alloptions() [closed]

On every page load I am seeing this in the Query Monitor plugin QUERY: SELECT option_name, option_value FROM wp_options WHERE autoload = 'yes' Calling Function: wp_load_alloptions() Times Called: 3,...
0 votes
0 answers
25 views

How to create a database table in Wordpress using PHP

I'm trying to build a pluging, in the php file I have tried the following code to create a table: <?php function createTable(){ global $wpdb; $table_name = 'tblresults'; if($wpdb-&...
0 votes
0 answers
7 views

WP Multisite Users Not Linking

Hi everyone… I’m trying to make a multi site (same site but different languages) and I need it to be available to all users, but when I make an account, it can only log in but has no access to any ...
  • 1
1 vote
0 answers
9 views

Custom WP_query in Jnews theme returns thousands of posts

I'm developing a client website with around 53K posts where I switched to the theme Jnews and I'm using a child theme. When I add a simple custom WP_Query to get the latest 3 posts from standard post ...
  • 11
0 votes
1 answer
31 views

Create custom table for wordpress custom registration flow

I need to import some data about users from an application into the wordpress database. I'm thinking to use the wp_users and wp_users_meta tables to store these informations. While I need to create ...
  • 7
0 votes
0 answers
17 views

Database structure Menu Item

I want to write the menu items into the database using a program. I also saw the structure of the database here, but I don't understand the dependency of the menu items. I also created a test menu ...
  • 1
0 votes
1 answer
26 views

How can i change the nicename and the displayname in a bulk in the database?

On my website, I use a membership plugin, which signs up my users with their email-addresses for the username. Now I need to update the nicenames and also the displaynames to the IDs from the users ...
0 votes
0 answers
14 views

Creating custom permalink tags in the database

Is there a way to create custom permalink tags (%customtag%) in the WordPress database and/or programatically? I am having a hard time looking through the database structure finding where in the ...
0 votes
0 answers
30 views

SQL query into to WP query

I can do it from within phpmyadmin using the following SQL Query: SELECT * FROM $wpdb->postmeta WHERE (meta_value LIKE '%$Job_param %' OR meta_value LIKE '$Job_param' OR meta_value LIKE '% $...
  • 149
0 votes
0 answers
9 views

Fragmented Static Conversion of Wordpress Pages

Consider this, A wordpress site has 1000 pages, and each page having 3-8 subpages, the subpages do not change content, but their number increases reaching a maximum of 8 or sometimes 10 in rare case ...
0 votes
0 answers
26 views

Advice how to connect custom database with Wordpress, change data in Wordpress and finaly use this data

Is it possible to create a page in WordPress that will allow logged-in users to create new or change existing content from the custom database? So I think this task could be divided into three parts: ...
0 votes
1 answer
78 views

SQL Query to get post_id from wp_posts and and meta_key(s) from wp_postmeta

I have a custom post type called media_coverage and need to export via PHPMyAdmin some of the data in that post type that is in wp_posts (post_title) and also in associated wp_postmeta (meta_key) keys....
1 vote
2 answers
79 views

Running one-off cron jobs when WP_DISABLE_CRON is true: can I hit /wp-cron.php?

I have a plugin that needs to do a "database update" sort of operation, going through all users and performing a particular database operation on each one. It's designed for sites with large ...
  • 441
0 votes
1 answer
92 views

Best way to search and replace within serialized database strings?

The frustration of serialized data in WordPress has been around for years... trying to search and replace strings in your database using tools like WP-CLI, MySQL queries, or even plugins like Better ...
0 votes
0 answers
42 views

Getting URL GET parameter with Code snippets and storing it in database?

I need to extract specific parameter utm_medium that is passed as parameter to all pages or posts on my WP site and store it in database. So every time someone visits my post I must collect that ...
0 votes
0 answers
10 views

How do I have a user upload a blog post and then retrieve that to display in a card on the site?

Hello everyone, this is my first time on a forum like this so please be gentle! I will try asking and answering as accurate as I can. I have to create a site in which you can send in some data using a ...
  • 1
2 votes
1 answer
36 views

How can I get a plugin to hook 'dbdelta_queries' -- a filter used during version update?

I have a plugin where I want to intercept database changes made during the upgrade process. It looks like the WordPress Way to do this is with the 'dbdelta_queries' filter. The trouble is, my plugin'...
  • 441
0 votes
2 answers
56 views

What is the purpose of the "term_id" column in the "wp_term_taxonomy" table?

The table below shows some example rows from a "wp_term_taxonomy" database table. Notice that values of the "term_taxonomy_id" and "term_id" columns are exactly the same. ...
  • 105
0 votes
1 answer
30 views

Delete user with only subscriber role

I have a site which have 90k+ user with subscriber roles.I want delete user with only subscriber role using phpmyadmin . So I know how to delete it But some users have multiple roles for example few ...
  • 11
0 votes
0 answers
11 views

Is it possible to modify posts table to only read for more recent ones?

I have a news site built with WP. Everyday about 100 new posts are published. As a result, at the end of the month there can be as many as 3000 new posts in the posts table. Consequently, by the end ...
0 votes
1 answer
30 views

Is it important to have integers inserted using %d rather than %s?

Is it important to have integers inserted using %d rather than %s? I have a situation where there is a large number of fields and values. When database changes are made, it is difficult to match all ...
  • 259
0 votes
1 answer
24 views

Which table (and column) has the content of configured get_post_meta?

I have an already up and running WP web site. Its fully configured - some years ago :-/ Now there is the request to change the image. Somehow I don't know any longer how to do it. I managed ...
  • 103
0 votes
2 answers
36 views

Custom AJAX Endpoint not returning any result

Hello I'm new to Wordpress and I'm trying to create an ajax endpoint that outputs JSON so I can access it through jQuery Datatables. I'm using Air Light theme for my current site and what happens when ...
0 votes
1 answer
34 views

Building a REST API for your web app exposes primary keys of DB records?

I'm new to WP-REST and need to build a REST API for a wordpress project, but I'm somehow wondering about one aspect. Good practices say, and the built-in WP API for posts also shows, that you should ...
  • 391
0 votes
1 answer
21 views

Bulk Updating Post Date in 1 day Increments

I have 1700 Motivational Updates + Write ups imported to WordPress. The problem is they are all published on the same date. I'd ideally like for them to be published once per day. I researched a lot ...
0 votes
0 answers
11 views

Wordpress keeps redirecting to localhost

Whenever I enter my domain name I can access all other files, but once I go to /wordpress it'll redirect me to localhost (which doesn't work). My wp-config contains the right address, so does my ...
0 votes
1 answer
43 views

How to insert and call new data in wordpress website database through a plugin

I have a dropbox button that user interact with it to get some data like video's id and video's name using Js code. What I want to do is insert these data in the database using pair data structure and ...
  • 5
0 votes
0 answers
16 views

Connect a membership plugin to an external database

I'm looking for a way to connect a WP membership plugin to an external database. We have a magazine (print) with paid and free subscriptions and we have a website which anyone can view. The idea is to ...
0 votes
1 answer
23 views

get value from 'terms' table

so I feel like I am missing something very obvious, but I need to get a value from the database table 'terms', and it seems get_terms fetches from taxonomy table. I've tried get_term_by as well but to ...
  • 3
1 vote
0 answers
31 views

Is there any way to get all meta and standard columns for any WordPress object after searching based on meta key and value

I have a scenario where I have a meta key and value and a WordPress object name, I want to search based on the meta key and value and retrieve all details stored in db, for example if this is for a ...
  • 26
0 votes
0 answers
12 views

How to make a Product page without ordering and database

I am learning Wordpress currently so far I know how to design the webpage, but what I want to do next is to make a product page without ordering. What I want is the following: List all my products ...
  • 101
0 votes
1 answer
69 views

Unserialize Custom Field & Save as Multiple Rows in Wordpress Database

I have a custom field in post_meta table of wordpress database. It's called 'combined'. I want to seperate the values based on key and save them as multiple rows if there are multiple values for the ...
0 votes
1 answer
46 views

Serialize data before inserting into the DB

I need to store some post IDs in the DB in a custom table/field. The IDs will have to be stored in a serialized format. I know that, ie. for the options, serialization is done automatically for add/...
  • 123
0 votes
1 answer
56 views

How to set up hierarchical relationships without using plugins / meta query

I'm running a large database of musical artists and their releases. I inherited the site after it running for a long time. There are currently several different custom post types, created with a ...
0 votes
0 answers
56 views

How To Save Data From Remote APIs To ACF?

I've been attempting to ingest remote data from an api partner into Wordpress. To data I've used wpallimport plugin, but it's quite limited. How would one connect with a remote api and then save the ...
1 vote
0 answers
18 views

WordPress is not creating table in database after activating plugin,

I struggled with this a long time! Can anyone help me? My plugin is not creating a database table once activated. The following code is in the main plugin file. function woocq_activate() { global ...
  • 11
0 votes
1 answer
35 views

custom tables in wordpress Database? (can i just create them with sql?)

i just want to create a custom Table in my WordPress database and i saw many php functions to deal with that my question now is : can i just create them with an sql command and for what do i need to ...
0 votes
0 answers
97 views

Having a repeating custom field in admin custom post type, what I'd go better with, for DB's sake? ACF repeater or query a different post type?

I have: A main custom post type - 'Cards' - each post showing its ACF repeater custom field - 'operations' - with the following sub-fields: 'add/remove', 'amount, 'value', 'date'. Let's say the fully ...
0 votes
1 answer
35 views

Can we intercept user_login and user_pass from a wp_login_form?

with my plugin, I have a login form. I use the wp_login_form() function of Wordpress. As you know, this function links to the wp-login page. But if the user_login is not present or if the email is ...
0 votes
0 answers
13 views

Search Character Set Problem

I have a local WordPress setup in the Turkish language. I have a post title like ... MAMASI .... When I search by keyword maması in lower-case it doesn't find post. I try the table Character set ...
  • 181
0 votes
0 answers
53 views

Add posts to custom table in database instead of wp_posts

What the code does: Imports posts, loops through all the posts and calls wp_insert_post to create a new posts for each import. Objective: Import posts and store them in another table, not under the ...
  • 189
0 votes
0 answers
24 views

Can't log into wordpress site - I have made a new user and still cant access

I recently took over website management for my company but I can not access 1 of our sites. The user name and password provided by the last management team does not work. I refrenced my Wp-Config to ...
0 votes
0 answers
11 views

Need help with creating a searchable user data by name or specific number like ID

Thanks for this gift. Here is my issue, i wish to be able to add users profiles to my wordpress company site in which we register the users name and other details as need be. The purpose for this is ...
0 votes
0 answers
7 views

Compare User meta_value with Product meta_value

In Wordpress I've added a new field called "user_branche" on the user edit profile page within the admin. On the Woocommerce product page in the admin I added a meta field called "...
  • 113
0 votes
2 answers
282 views

Check if an option exists and get its value in one hit

I have an option admins_settings that has an array of sub-options that is stored in the wp_options table. Before I get its value from the table, I check if this field exists by running this code: if ( ...
0 votes
0 answers
29 views

New installation fatal error in 5.9.3 at edit or create entry

I just make a new download and installation of Wordpress. So far so good until I edit or create a new entry. Remove it works. Notice: Undefined property: WP_REST_Terms_Controller::$sql_clauses in /wp-...
0 votes
0 answers
40 views

Storing transients giving database error

Sorry if vague, trying to track down recent website slowdown reasons, and query monitor shows me this as a DATABASE ERROR consistently for two particular transients being added: Following the ...
1 vote
1 answer
207 views

Make id column as AUTO INCREMENT on plugin activation

I am creating a wordpress plugin in which I am creating a table, the table is getting generated successfully on activating the plugin but the problem is, column id is not generating as AUTO INCREMENT ...
0 votes
1 answer
57 views

What's wrong in my PHP code? I'm using Wordpress Astra Theme and I can't insert data into my SQL

<form method="post" action="functions.php"> <div class="form-group"> <input id="customer" name="Customer Name&...
0 votes
1 answer
42 views

I want to replicate a wordpress website over multiple servers

I've noticed a bit of a spike in web traffic as of late and I want to balance the load across multiple servers. The website is running the latest version of Wordpress. Can I setup a second website ...

1
2 3 4 5
50