Error: Failed to import tag/post

After a long day of tweaking, I found there were several problems: The whitespace in the XML matters. The importer throws errors when each item’s child elements are not in the same line. Any whitespace between them will cause an indentation error and fail that row’s import. This doesn’t seem to matter on the actual … Read more

Importing XML to WordPress, permalink problem

I figure out was I was doing wrong. There´s a tag named “post_name” in the xml. And there´s a tag named “link” So I have to set this two fields, with the adress that I need. So in the “link” fild is setup this way: <link>http://localhost/site/man-clothes/jeans-pants/ripped/rock-style</link> And the “post_name” fild I setup like this: <post_name>man-clothes/jeans-pants/ripped/rock-style</post_name> … Read more

WP CLI not importing media files

wp import something.xml The possible problem with this solution is when the original domain is not available from the web server you are on. Try to ping the domain name from the AWS LightSail. You know for the wpcom-themes.svn.automattic.com/demo/theme-unit-test-data.xm‌l, there you have images like wpthemetestdata.files.wordpress.com/2010/08/manhattansummer.‌​jpg, but when the domain wpthemetestdata.files.wordpress.com is not available anymore the … Read more

can’t import xml file

finally i split my xml file with wxr splitter and did as http://www.rangerpretzel.com/content/view/20/1/ inform then import it .

WXR slicing script

Googling for “split wxr file” returned several results, including python script for splitting .wxr file GUI for splitting WXR files (OSX and Windows) .Net splitter for WXR files Haven’t tried any of these, but the comments look positive.

Is there a way to import Blogger into bbPress?

No, there isn’t. And unfortunately that’s because you’ve been using Blogger to do something it was never intended to do. I’m not saying this is a bad thing. Blogger (and WordPress) are built to handle an article format: One author publishes a large article Other writers create short-format comments Comments and replies are threaded together … Read more

Importing custom post types using WordPress Importer, how to check for meta field values

I guess you want to modify these lines in the WordPress-Importer plugin: $post_exists = post_exists( $post[‘post_title’], ”, $post[‘post_date’] ); if ( $post_exists && get_post_type( $post_exists ) == $post[‘post_type’] ) { to add some post meta checks. I don’t see any hooks inside the function post_exists() that we could use. Remark: I don’t recommend editing plugin … Read more

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

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