phpmyadmin
Export SQL query based on custom field?
Change your query to: SELECT wp_posts.* FROM wp_posts INNER JOIN wp_postmeta ON wp_postmeta.post_ID = wp_posts.ID WHERE ( wp_postmeta.meta_key = ‘Color’ AND wp_postmeta.meta_value IS NOT NULL ); That way it only gets the data in wp_posts, but still filters based on your criteria.
Recovering a wordpress blog that got corrupted
Assuming you didn’t change the table prefix from wp-config.php, you can find your posts in the tables wp_posts and wp_postmeta.
Phpmyadmin – post editing
Mysql allows you to run queries that apply to all post, see example : UPDATE wp_posts SET POST_CONTENT = replace(POST_CONTENT, ‘<a href=”http://mysite.com/my_link”>mylink</a>’, ”); This code allows you to delete <a href=”http://mysite.com/my_link”>mylink</a>on all posts. But in your case I doubt all links are the same so you need a pattern. Perhaps it can be done with … Read more
SQL: Select wordpress posts with given text string and add a custom field to them?
Here you go (you’re really close): INSERT INTO wp_postmeta (post_id, meta_key, meta_value) SELECT ID AS post_id, ‘customer_reviews’ AS meta_key, ‘On_or_delete’ AS meta_value FROM wp_posts WHERE wp_posts.post_content LIKE ‘%Customer Reviews%’ AND wp_posts.post_type=”post”; ` Edit: You could also just change IS IN to IN. I rewrote the from part of the query since a subquery was unnecessary … Read more
Installing local to live WP into subdirectory
Since you want to test out your existing(local) site on the server; you have done the right thing as far as I can see on pastebin except for 1 thing On step 10 – you replaced all occurances of “localhost” with your servername. Instead you should have replaced it with servername/directoryName. If you still have … Read more
How to track who has deleted files
WordPress does not log anything natively. Closest it has to such functionality are just post revisions and ability to enable logging of PHP errors. There are plugins around to log events, but since you hadn’t one installed in advance it won’t help you retroactively. If you think it was from action by logged in user … Read more
wp_option table error while importing
I was able to solve my own problem, while its was a very struggling effort.If your database is corrupt, but you want to restore your site. Just open your database in a any program like TextEdit, Notepad++ and make sure you copy the basic databases mention here in a new database, that will at least … Read more
Plugin can’t write to database even though permissions appear correct?
The Formidable Form plugin seems to ignore database errors in many places in the code. Setting WP_DEBUG to true uncovered that the forms are not created because some tables are missing (no indication is given to the user). Further investigation has shown that the tables fail to create when the plugin is activated (no indication … Read more
Using mysql to replace img src?
This feels like it is too link-heavy for an answer, but oh well. You can either use the Velvet Blues Update URLs plugin or the Serialized Search and Replace script. Either will allow you to search for a string in the database and change it to something else. The former lets you do it from … Read more