HTML Entities in Post Title

It seems like the crux of the question is this: This causes the first ‘if’ condition to return TRUE and it inserts a duplicate post. Check for the post_name instead. That value is normalized to lowercase and dashes by sanitize_title_with_dashes so you won’t have this issue. That value is also the one that WordPress enforces … Read more

Error while importing database

When exporting from original database you should choose to create the tables if they dosn’t exist (First error). If you didn’t choose that option (in phpMyAdmin that option exists, not sure in other database tools), the import file can not create the tables for your and you need to create then prior to start importing … Read more

Rewrite database urls

Try this plugin: http://wordpress.org/extend/plugins/search-and-replace/ – It helped me dozens of times. Or try this query: UPDATE tablename SET tablefield = replace(tablefield, “findstring”, “replacestring”); Or try this method, dump the database, open the SQL file, do a find and replace in a text editor then reimport it. Take care to backup your database prior to making … Read more

wpdb insert and boolean fields

BOOL or BOOLEAN are as far as MYSQL is concerned just replacements/synonyms for TINYINT(1), tiny integer, so using %d for integers is the correct way to do it. Some additional information: Codex: Class Reference – wpdb – Placeholders MySQL: Numeric Type Overview MySQL: Boolean Literals MySQL: Integer Types

WP_USE_EXT_MYSQL

This constant is actually never defined in core code at all. You can define it yourself in wp-config.php configuration if you need to, but core doesn’t need it defined for normal operation. It only exists for re–configuring into running untypical setup.

How to Create a Admin User for A WordPress Site via MySQL (PHPMyAdmin)?

You need to run those below queries- INSERT INTO `your-wp-database`.`wp_users` (`ID`, `user_login`, `user_pass`, `user_nicename`, `user_email`, `user_status`, `display_name`) VALUES (‘1000’, ‘your_username’, MD5(‘Str0ngPa55!’), ‘your_username’, ‘[email protected]’, ‘0’, ‘User Display Name’); INSERT INTO `your-wp-database`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, ‘1000’, ‘wp_capabilities’, ‘a:1:{s:13:”administrator”;b:1;}’); INSERT INTO `your-wp-database`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, ‘1000’, ‘wp_user_level’, ’10’); But notice here your-wp-database … Read more

How to bulk delete all WordPress subscribers?

I ended up deleting all users who had not made a post using the following two queries: First: DELETE FROM wp_users WHERE ID NOT IN (SELECT post_author FROM wp_posts) Second: DELETE FROM wp_usermeta WHERE user_id NOT IN (SELECT ID FROM wp_users)

Update a WordPress post or page takes 60+ seconds

There’s a plugin called Debug Bar which you can find at http://wordpress.org/plugins/debug-bar/ Don’t leave this enabled in production! But it will tattle on slow MySQL queries. You might also wish to try using WP Clean Up. http://wordpress.org/plugins/wp-clean-up/ This flushes out stale entries in your database, and does a little bit of table reorg/optimization.