WordPress.org

Ready to get started?Download WordPress

Forums

WordPress import not importing custom taxonomy (8 posts)

  1. oh_hello
    Member
    Posted 1 year ago #

    Hi All,

    I'm trying to import a custom post type from one blog to another. (126 posts in the custom post type).

    I've exported using WordPress' export function from WP version 3.3.2 and trying to import into 3.2.1.

    I can get all the posts to import into the correct custom post type, but none of my custom taxonomy or meta information is being imported in.

    In both WPs I have the exact same name for each of my custom post types and taxonomies, I literally copied/pasted my functions.php over.

    Any idea why my import is adding all posts of my custom post type but not my custom taxonomy? Am I missing a step somewhere?

    Thanks in advance.

  2. Andrew Bartel
    Member
    Posted 1 year ago #

    Any particular reason you're rolling back versions?

  3. oh_hello
    Member
    Posted 1 year ago #

    Not really, the sites were just built at different times. Do you think it will make a difference? Thanks.

  4. Andrew Bartel
    Member
    Posted 1 year ago #

    Why not upgrade the other one first now while you have the opportunity before you port in a bunch of content?

  5. oh_hello
    Member
    Posted 1 year ago #

    The posts I'm trying to import are just one custom post type. The site has other post types with lots of content (and a few plugins) so I'm not ready to undertake an update at this point. Especially if I'm not sure it will solve my import issue.

  6. Andrew Bartel
    Member
    Posted 1 year ago #

    My standard solution would be to clone the site onto a dev server, run the upgrade, and then try the import so you can break it at will without it harming the public site.

  7. oh_hello
    Member
    Posted 1 year ago #

    I'm at a loss here, I "downgraded" my 3.3.2 version to 3.2.1 and exported so I was doing an export/import from the same version of WP. Still no luck, I get the custom posts but no custom taxonomy or fields.

    Just to clarify I'm doing an "All content" export to ensure I get all relevant info in my export file.

    Just in case I'm missing something, here are the relevant bits from my export blog's functions.php file (post/taxonomy only, the custom fields I'll leave out for now):

    function build_taxonomies() {
        register_taxonomy(
    	'site_archives_cats',
    	'site_archives',
    	array(
    		'hierarchical' => true,
    		'label' => 'Categories',
    		'query_var' => true,
    		'rewrite' => true
    	)
    );
    	register_taxonomy(
    	'site_archives_tags',
    	'site_archives',
    	array(
    		'hierarchical' => false,
    		'label' => 'Tags',
    		'query_var' => true,
    		'rewrite' => true
    	)
    );
    }
    add_action( 'init', 'build_taxonomies', 0 ); 
    
    function create_my_post_types() {
    	register_post_type( 'site_archives',
    		array(
    			'labels' => array(
    				'name' => __( 'Archives' ),
    				'singular_name' => __( 'Archives' )
    			),
    			'public' => true,
    			'show_ui' => true,
    			'publicly_queryable' => true,
    			'exclude_from_search' => false,
    			'menu_position' => 5,
    			'supports' => array( 'title', 'editor', 'excerpt', 'revisions'),
    			'taxonomies' => array( 'site_archives_cats', 'site_archives_tags'),
    			'has_archive' => 'article-archives',
    			'register_meta_box_cb' => 'add_additional_info_meta',
    			'rewrite' => array('slug' => 'archives')
    		)
    	);
    }
    add_action( 'init', 'create_my_post_types' );

    And my import blog's functions.php is an exact copy/paste.

    Any ideas at all on why the custom taxonomy is not being imported? I feel like it must be something painfully simple, but I just don't get it.

    Thanks.

  8. littlericky
    Member
    Posted 1 year ago #

    @oh_hello If you still have your previous WP blog up you can watch my video tutorial that shows you can clone your blog and move it so EVERYTHING remains in contact and is fully functional afterwards here: http://backuprestoreblog.com/

    After you watch it, be sure to leave your questions, comments response and if there is any way that I can help you with your blog.

    All the best,

    Paul Facey

Topic Closed

This topic has been closed to new replies.

About this Topic