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

Restrict adding more administrator accounts

How to limit number of WP site admins to i.e. 2. So if current WP admin wants to create new admin, old account need to be deleted. (this can be added even on database level) I need this feature to ...
0
votes
0answers
15 views

Inserting to a WP database

I have this test plugin that I am using to try and insert into my WordPress database. It runs without a problem but it doesn't insert and when I click on the form submit it directs me to no page found ...
0
votes
0answers
23 views

Lost database connection

Today our database server crashed and we lost all our 12 wordpress sites. In the mariadb.err file, we have 100's of error like this before and after the crash. 2019-10-15 12:57:35 34895617536 [Note]...
0
votes
0answers
6 views

Search and replace text with line break in database

How can I search and replace two sentence with line break? For example, I want to replace this in my database- Imagination is more important than knowledge. Imagination encircles the world. If it's ...
-2
votes
0answers
15 views

Wordpress wp_post table changes not affecting the page

I have a wordpress site. Recently I have changed the domain. In the wp admin page, I have changed corresponding areas which is related with domain name. Site works but the content created with the ...
0
votes
0answers
7 views

WAMP WORDPRESS connects to MySQL but will not connect to MariaDB

Wordpress on WAMP cannot establish a connection to MariaDB only connects to MySQL Keep getting: Can’t select database How to set Wordpress to connect to MariaDB? I have asked the same question in SO; ...
0
votes
1answer
20 views

How to create plugin/ page that reads from database

I am working on a WordPress website. I have a MySQL database with data in it. I want to showcase this data on my website (I already have a local PHP page that does what I want). I have been told that ...
0
votes
1answer
22 views

wp_posts table extremely large

my posts table in my WordPress database is nearly 1GB in size despite only having 3,409 posts, which is vastly larger than other WordPress databases I have. None of the rows in the posts table seem to ...
0
votes
0answers
8 views

Share BuddyPress plugin for two different wordpress installation

I have these two subdomain site. subdomainA and subdomainb. Both use one database but with different prefixes. I shared the users for subdomainA to subdomainB. Next think I would like to do is ...
0
votes
0answers
9 views

import database and new fields in wp_posts table

I have a database with multiple fields from a library website, several of those fields match those of the wordpress database (post_title, post_author, category), but I have other fields that do not (...
0
votes
1answer
18 views

How to update a database entry with a wordpress plugin?

I created a plugin which creates a database-table (wp_mediopay) and a widget in the admin dashboard. In this widget is a form, which should update an entry in the database table after being submitted. ...
0
votes
0answers
13 views

Can I disable auto increment of WordPress Posts Database to utilize previously deleted records?

When I delete a record field of WordPress posts database such as Post, Image, Page, etc. and add new item then it will add in a fresh record field due to auto increment function. But I would like to ...
0
votes
1answer
14 views

How to force set same page as homepage and blogpage in static page settings

I am trying to set the same page as my blog page as well as my static homepage. You might ask why i wanna do that, basically in the preview it shows me result that i am after, but i am not able to ...
0
votes
0answers
15 views

How to separate value in database column in template file?

I'am using Contact Form CFDB7 plugin to capture and store into database when user submitted a message using Contact Form 7 and i want to display list of them on the frontend inside my template file. ...
0
votes
2answers
22 views

Connect to database in the header of my WordPress website

I have created a table in my WordPress database. Now, WordPress gets all its data about different posts and pages from the database. This means that WordPress always connects to database automatically ...
-1
votes
0answers
13 views

Optimising large Wordpress database

I'm in the process of designing a site that will have thousands of posts. I'm wondering what the best practices are for optimizing such a large database so that the site still runs fast. Are there any ...
0
votes
1answer
28 views

mysqli_query(): MySQL server has gone away for Curl Request

I have created a WordPress Plugin which after activating shows result in jquery Datatable. We are fetching the result via CURL Post. The Post URL is a ASP.Net Application on Windows Server. The ...
-1
votes
1answer
19 views

Wordpress API standard compliance and specification for external database [closed]

HOW TO CONNECT WORDPRESS WITH EXTERNAL DB SERVER VIA API?
0
votes
1answer
24 views

How to get meta key list efficiently?

I have this function to get the meta keys for all the post types. public function pgggo_custom_post_type_keylist() { //gets the list of post types $...
0
votes
1answer
35 views

Programmatically generate new pages for a site based on page template and content elements accessed via DB

I 'd like to programmatically generate new pages for a site - the textual and visual components of the content are stored in a DB, this includes the names for the different locations the pages are ...
0
votes
0answers
13 views

How to rerieve comments and their replies from DB

I need to get comments and their replies from database to show them as json for an android app, so how can i tell if a comment has replies (get their number ) , and how can i list replies nested with ...
1
vote
1answer
26 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 ...
0
votes
0answers
16 views

How to get user avatar via WPDB

For my REST-API i need to get for every post the username, date ... and Avatar ! $query ="SELECT POST.ID, POST.post_title, POST.post_date, USER.user_nicename FROM wp0x_posts POST INNER JOIN ...
1
vote
1answer
16 views

Proper way to edit a post via phpMyAdmin without breaking the compare revisions tool

In hundreds of posts on my site a specific string needs to be replaced by another one, but this replacement has only to be executed on the published post, not on the revisions. The plugins that I ...
1
vote
2answers
31 views

Wordpress Relational Database

Can we consider the Wordpress database a relational database? Some tables are related to each other, but it doesn't work with foreign keys. So, is it a relational database??
0
votes
1answer
14 views

Inserting data with Geometry field

I am trying to insert data which contains a POINT field. I am using the $wpdb->insert method but when generating the SQL it is wrapping the POINT in quotes. global $wpdb; $table = $wpdb->...
0
votes
1answer
22 views

Enter user registration information in the database

can you tell me what's wrong with this code? I simply have to enter those data in the user database on Wordpress. Here is my code: // Inserisce utente nel DB $user_data = [ 'user_login' => $...
0
votes
0answers
11 views

How do I pull my live site to my local environment to set it up with Git?

This is not a duplicate of any current similar questions. I should know, I've read most of them. See below for why. I must have read from top-to-bottom more than twenty articles about Git and ...
0
votes
1answer
16 views

Is it necessary to sanitize wp_set_password user input?

I'm trying to add a password form to the WP registration form. See the code below. I was wondering if I need to sanitize this specific user input? (and if so how?) If I understand it correctly, WP ...
0
votes
0answers
15 views

Can´t update BDD in time

Mi expertise with WP coding is basic, almost reach intermediate level. I know there must be a way to achieve this. I am using 2 loops one inside the other, to find matching values and save in DB. ...
0
votes
1answer
18 views

WordPress Fatal error: Uncaught Error: Call to undefined function dbDelta()

On plugin activation hook I want to create a table but the following code is giving Uncaught Error. I just wonder why it is not giving this error since I am properly including update.php. global $...
0
votes
2answers
19 views

Getting values from form and saving in database but spaces are inserted instead of form values

<?php /* Template Name: Dummy Practice Page*/?> <div id="main-content" class="main-content"> <div class="main-content-inner"> <form method="post"> &...
0
votes
1answer
16 views

Troubles when I want to connect to another DB

I want to connect my Wordpress website 1 to database from Wordpress website 2. Here is my code: <?php $myotherdatabase = new wpdb("username","password","databasename","localhost"); $motscles = "...
0
votes
1answer
27 views

How to convert srcset links from https to http?

After trying SSL and having some unfortunate problem with it, I decide to go back to HTTP. Everything seems find, by the srcset attribute of <img> tag is still https everywhere. This post ...
0
votes
1answer
41 views

Pages from custom table

I have custom table "catalog" inside wordpress database: id|name|description|slug|price I have template file "catalog" and page "Catalog" where i show all items from catalog table. But how i can ...
0
votes
0answers
14 views

mamp upgrade database backtrace error

I use MampPro to setup my sites on the local server... all well and good. So, every time I fire it up I get the upgrade nag... so, I figure its time, and hit the upgrade... and it does its thing. ...
0
votes
0answers
28 views

WooCommerce: /shop/ always redirects to homepage

When I define the shop URL (WooCommerce) as www.domain.tld/shop/ I always get redirected to the homepage (www.domain.tld) when trying to access www.domain.tld/shop/ (I receive a 302 redirect with x-...
1
vote
1answer
34 views

I am switching laptops. I host my WP server through MAMP. I want to transfer [closed]

I am switching laptops. I host my WP server through MAMP. I want to transfer the entirety of my server to my new laptop so I can sell the old one. Should I just install mamp on my new MacBook & ...
0
votes
0answers
7 views

WordPress Deployment of new data

We have a WordPress site and we are looking for a way to port data updates from the staging environment to the live one. Say for example, we update the content on a page and we prepare it all on our ...
0
votes
1answer
34 views

Two WordPress sites sharing the same database

Here is what I'm looking to do. I would like to set up two WordPress sites. The one site will be the production and the other site will be the staging. What I'm trying to accomplish is to have the ...
0
votes
0answers
7 views

Reset views valors column of wp_post_meta

How can I update the column views values of the table wp_post_meta and leave them at 0? I have a plugin that shows the number of visits of a particular post and gets the information from that table ...
0
votes
1answer
24 views

Intermittent Yet Problematic Error - “Error Establishing A Database Connection”

👋 I know you have probably come across many a member here who complains of the following error: Error establishing a database connection This either means that the username and password ...
0
votes
1answer
24 views

WordPress site migration - locked out of admin area

I migrated my WordPress site by uploading the wp-content file from the original site to the new site and dumping the database of the old site onto the new one. However, this has resulted in me being ...
0
votes
0answers
15 views

Replace content in several posts: Embeded video code (shortcode) with a new video player code

I have a wordpress site using old video plugin called FLV Embed and i want to replace it with any new video player code or any other video plugin shortcode. Currently this plugin uses this shortcode ...
0
votes
0answers
14 views

Store Featured Image in base64 string for Restful API

I am using WordPress' default REST API for posts. The app also needs images as base64 string. For this, I convert featured image to base64 on the fly. For example, in an API call, 10 posts are being ...
0
votes
0answers
67 views

Could not insert post into the database - Media

im currently having a database error in my Wordpress Media section. Everytime i upload a file i get a "Could not insert post into the database" error. The site was migrated from one hosting to ...
0
votes
2answers
22 views

How to Assign / Move all Deleted post to a category

I have a database of 50,000 articles, One of my categories contains post of 30k, I mistakenly Deleted a category that contains 30k Post, But all the posts still exist. I have search google for the ...
0
votes
0answers
8 views

Get items from woocommerce account page

I want to get all the menu items from the woocommerce account page. When we hook into woocommerce_account_menu_items filter, it passes an array of the menu items, I want this array but not the in the ...
0
votes
0answers
44 views

How to extend WP_query to a specific table?

I created a new table (named extrapage) in the wordpress database (named wpsite_db). I have added to this table some pages not published directly with wordpress and I want these pages to be considered ...