Location of image metadata on my server

The image url is store in wp_posts as an attachment post_type with their corresponding posts(s) as parents. From Codex, see Template Tags Show All Attachments I believe something like this would retrieve all attachments in DB outside of a loop: global $post; $args = array( ‘post_type’ => ‘attachment’, ‘posts_per_page’ => -1, ‘post_status’ => ‘any’, ‘post_parent’ … Read more

Array Formation Issue

There a few things going on here. First, you’re getting back a multidimensional array (array of arrays) where the nested arrays have column names as keys. The reason for this is your use of the ARRAY_A parameter. You can read about the output types in the codex entry. You may be just fine using the … Read more

Stringing together content from different databases

If the content to import is in another database that you have access to (via custom programming), then it is technically possible to extract data from the source database and create pages/posts from that data/content into your WP site. See my answer to Automating Page Creation . The link to https://developer.wordpress.org/reference/functions/wp_insert_post/ contains the WP code … Read more

MySQL query for taxonomy-meta

Try select t.name, t.slug, tm.meta_key, tm.meta_value from wp_term_taxonomy AS tt inner join wp_terms AS t ON tt.term_id = t.term_id inner join wp_termmeta AS tm ON t.term_id = tm.term_id where tt.taxonomy = ‘census-tract’ order by t.name

How can I detect right db type?

wpdb->dbh is declared as protected property, you should not even have access to it, unless you are subclassing wpdb? The only public property is wpdb->is_mysql which is just hardcoded for true and meant for detection of non–native database drop–ins. So overall wpdb context is meant to be internal, you set up the connection and let … Read more

mysqldump to a tar.gz

mysqldump –opt <database> | gzip -c | ssh user@wherever ‘cat > /tmp/yourfile.sql.gz’ You can’t use tar in a pipe like this, and you don’t need it anyway, as you’re only outputting a single file. tar is only useful if you have multiple files.