0
votes
0answers
8 views

wp_insert_post another database with custom field

wp_insert_post with the command you want to transfer the contents to another database, I use the following command <?php require('wp-config.php'); $conn = mysql_connect($dbHost, $dbUser, ...
0
votes
0answers
22 views

Import posts into SQL

Is there a way to bulk import posts directly into the database? like from csv into sql database. I don't want to use those csv import plugins since they don't always work they either only import half ...
0
votes
0answers
35 views

SQL query to remove first image in all posts

I've built a site up over a few years (3,500+ posts) where I've inserted images using the traditional method into the post content itself. I'm now moving to a different theme, and have made the first ...
0
votes
0answers
46 views

Delete junk text from all the post using my sql command

Because of an autoblog plugin, my site has got junk text in every post! The text format is as below .. funny-pictures/funny-pictures-of-the-day-30-pics/attachment/funny-pictures-41-2/" ...
0
votes
1answer
207 views

Order posts alphabetically: how to set order=asc in mysql query?

I have this function: global $wpdb; // adjust the query to fit your needs $posts = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->posts WHERE post_type = 'post' ...
0
votes
2answers
166 views

update image path with words starting uppercase to lowercase chars

I have to convert the image path to lowercase characters inside wp_posts table. Right now, I have inside my posts this: <img class="alignleft" title="my image title" alt="my image alt" ...
-1
votes
1answer
173 views

FIND and REPLACE wp_posts AND IGNORE custom post type mysql query

does exists some MYSQL query for FIND and REPLACE wp_posts AND IGNORE all other wordpress and buddypress posts (buddypress-docs) and also custom post type = portfolio ? I want to find and replace only ...
0
votes
0answers
25 views

Dissapered all posts by 2013 year

Dissaperd all posts posted in 2013. There are no posts, images and tags for this year. I've checked it in the phpMyAdmin and find them. But they don't shows in administrtor panel. Any idea? Thanks!
0
votes
2answers
181 views

How to update wp_posts with just the returned comment count from wp_comments (SQL GROUP BY)

I am doing a special migration from someone's custom CMS to a WP installation. I successfully got the posts and comments migrated into their respective tables. Now I need to get the comment count ...
1
vote
1answer
106 views

Custom order for Mysql array

I have a Page of Posts, each post has a Custom Field "expired" which contains a date in the format YYYY-MM-DD which is used to order the posts. This date is used for a script that tells the visitor if ...
0
votes
2answers
148 views

get last post's link with SQL query

I have installed a WP on website A and I want the last post's links in site B. I haven't in site B any WP and I want to get the link of last post from website A. so I can't use WP API like WP_Query ...
1
vote
0answers
180 views

List authors with the last post title and order by last post date

I want to list authors with last post data and order them by last post date. Now i have this codes but i don`t know how to edit them. // Selects from tables wp_users and wp_posts, selecting published ...
1
vote
1answer
250 views

How do I write this SQL statement for Posts written in last 24 hours?

Someone gave me this SQL code to count the number of posts (of post_type 'mixtapes') in the last 7 days. I tried to convert it to 'in the last 24 hours' as well, but it's giving the wrong number. ...
0
votes
1answer
222 views

wp_insert_post - duration

i try to import a custom DB to the WP DB with about 2000 rows (custom post type). the problem is that the insert by wp_insert_post takes about a second per insert. Is this normal ? Is there a ...
-1
votes
4answers
2k views

Manually delete post from database

For whatever reason, I have a post and a page with the same slug name and it causes the db to hang. I can't alter the slug on either so I need to go manually delete the posts from the database and ...
2
votes
2answers
211 views

Tons of Twitter rows in my database

I have 264,307 "http" (post_type = http) rows in my wp_posts table. 99% of those have them have this post_title: GET http://twitter.com/statuses/user_timeline/@xcentric.json?count=100 and "error" ...
2
votes
2answers
775 views

modify all posts of a category to “no comments allowed”

I'm looking for a way to modify all posts of a certain category to be "no comments allowed" without going into each post settings, one by one, and modifying manually. Perhaps a MySQL statement? ...
0
votes
1answer
367 views

query for filtering published posts?

i need to filter count based on a date and post_status = 'publish', how to write a query to filter, as far as now i have filtered based on date, what is the query need to filter based published post. ...
0
votes
2answers
1k views

MySQL: Possible to replace all of wp_posts.post_content(id#) via UPDATE + REPLACE + SELECT?

EDIT: I want to update one field (post_content) within a known record (id of 4) of a known table (wp_posts) in a new database (new_db). The update has to come from one field (post_content) within a ...
0
votes
2answers
274 views

Deleting post tags removes categories

I'm trying to remove old post tags from a few WP installs. In some instances, I have over 20k tags for a few thousand posts. I've tried the following code: delete t.*,tt.*,tr.* FROM wp_terms AS t ...
1
vote
1answer
1k views

Tags to Post-ID mysql query. Tag Search

Im trying to implement a tag-based search. When i specify certain tags, tagged posts will be searched and the post-id will be displayed that matches the searchcriteria. Currently it only works for a ...
1
vote
3answers
97 views

Styling images coming from another blog

I had asked a question earlier, on getting post-thumbnails from another WP-site. There, the awesome Mike coded a SQL query whose results are then passes on to a PHP array. The piece of code from that ...
0
votes
2answers
325 views

Copying post thumbnail to custom field

I've just moved to another theme, and it uses the custom field bigimage for associating an image with a post, instead of using WordPress's post thumbnails. How do I copy the URLs of all existing ...
0
votes
1answer
119 views

What do these phpMyAdmin errors mean on my WordPress databaes?

I'm getting 3 very similar phpMyAdmin errors on one of my WordPress databases. More than one INDEX key was created for column `comment_approved` More than one FULLTEXT key was created for column ...