Some Post Content Does Not Show Up In DB Search

WordPress store the content from the editor inside the table post_content. But if you use additional plugins for your editor it is possible to store on different places, like custom tables and also in post_meta, really popular for third plugins to store date there use the meta API. Small hint, maybe you should use a … Read more

How to delete a particular row in a database table

Yes, you can use wpdb to delete the record in the custom table. Something like this in the wordpress function. require_once (‘../../../../wp-load.php’); if (!empty($_POST[‘id’])) { global $wpdb; $table=”table_name”; $id = $_POST[‘id’]; $wpdb->delete( $table, array( ‘id’ => $id ) ); }

Same database; different WordPress

You need to set the WP_SITEURL and WP_HOME in domainB.com’s wp-config.php file. Please add below code. define(‘WP_SITEURL’, ‘http://’ . $_SERVER[‘HTTP_HOST’]); define(‘WP_HOME’, ‘http://’ . $_SERVER[‘HTTP_HOST’]); In your server SSL setup then used below code define(‘WP_SITEURL’, ‘https://’ . $_SERVER[‘HTTP_HOST’]); define(‘WP_HOME’, ‘https://’ . $_SERVER[‘HTTP_HOST’]);

Export Yoast Keywords from MySQL/phpMyAdmin

This query pulls the post id, title, permalink, and focus keywords. You could modify this to pull the post meta description and title as well if you wanted. Change post_type to page if you want to pull pages. SELECT wpp.post_title, wpp.ID, wpp.post_date, mt1.meta_value as focus_keyword, REPLACE( REPLACE( REPLACE( REPLACE( wpo.option_value, ‘%year%’, DATE_FORMAT(wpp.post_date,’%Y’) ), ‘%monthnum%’, DATE_FORMAT(wpp.post_date, … Read more

cannot connect database

While it may possible to connect using mysqli->connect it is always better to make use of built in WordPress functionality (even for external code). By this I mean that you should use the wpdb class. See https://codex.wordpress.org/Class_Reference/wpdb for more information. First you need to link to the WordPress class: echo ‘<h1>WP Connect DB</h1>’; echo ‘<p>Directory … Read more

Debugging – logging database queries

The debug log will only capture PHP-generated errors as well as things you manually send yourself. So if it is not being created right now, then there are no warnings/errors being generated by PHP right now. In order to send things manually, you use error_log(). One quick note though is that you have to set … Read more

string literals in query

I misplaced a single quote. This query worked for me and solved my problem. update wp_postmeta set meta_value= concat( ‘a:1:{s:3:”url”;s:28:”‘, meta_value, ‘”;}’ ) where meta_key = ‘_woofv_video_embed’

How can i restore only Blogs from a SQL backup file?

“Blogs” or posts as they are called in WordPress are stored in the wp_posts table of your database. And custom fields related to your posts are stored in wp_postmeta table. So you should just be able to restore those two tables to get all your “Blogs”. This assumes your database is prefixed with wp_ of … Read more