Delete WordPress posts from URL list sql query

Yes you can. To delete posts with inherit post meta, use following code: DELETE p,pm FROM wp_posts p JOIN wp_postmeta pm ON pm.post_id = p.id WHERE p.post_name IN (‘post-1’, ‘post-2’, ‘post-3’) Pass slugs array to WHERE clause. If you want to delete only posts w/out postmeta (for some reason), use this code: DELETE FROM wp_posts … Read more

Double domain name in category URL-s

You can “workaround” the issue with a redirect in .htaccess, although it’s not clear why this double-domain-URL would be accessible in the first place. So, we can redirect URLs of the form example.com/example.com/?cat=6 to example.com/?cat=6, which you then say is correctly redirected to example.com/category by WordPress. For example, at the top of your .htaccess file: … Read more

Duplicate posts when posting nulls in records in phpMyAdmin [closed]

Problem is within function query_abstract_post_table where you have ‘$ids’ wrapped in single quotes: Problem: $sql = “SELECT * FROM $table_name WHERE ID NOT IN (‘$ids’)”; In the above example, only the first ID returned in the concatenated string (from the array) will be recognized by the NOT IN clause. Solution: $sql = “SELECT * FROM … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)