Better way to remove HTML syntax from all content

If you just need to change the post content, you can avoid the overhead of get_posts/WP_Query by directly querying the database: global $wpdb; $results = $wpdb->get_results(“SELECT ID, post_content FROM {$wpdb->posts}”); $total = count($results); $changed = 0; foreach($results as $entry){ $new_content = strip_tags($entry->post_content, ‘<img><a>’); if($entry->post_content !== $new_content){ $wpdb->query($wpdb->prepare( “UPDATE {$wpdb->posts} SET post_content = %s WHERE ID … Read more

Faking the “onSave” event

Have you seen wpshell? It’s a command line tool for wordpress. Basically, it’s a WordPress environment that lets you run arbitrary php – so you could set up a WP_Query that pulls all posts, loop through them, and fire that command on each one. Sort of what I had in mind, untested. Using wp_update_post() as … 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

How much of my site can I recover from public_html?

All site content for your WordPress site is stored in the database. The files that query and display the data, store settings, etc, are in the theme and plugin folders. There is the wp-config.php file that stores access credentials for your database. And media files are stored in the wp-content folder, but media files locations … Read more

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