• I am trying to copy some pages from one WP website (Site A) to another WP website (Site B).

    Site A is using version 3.4.2.
    Site B is using version 3.6.1.

    I know I can use Tools > Export to download an xml file but is it possible to export only certain files? WP’s Export feature has some filters like date and author but these filters may not be enough for me to get the required pages. I know there are some plugins that allows pages to have categories but the Export feature still cannot grab the pages based on those categories. Any suggestions on this and how can I do the whole process efficiently?

Viewing 3 replies - 1 through 3 (of 3 total)
  • I couldn’t find any useful hooks in export_wp(), maybe you could reverse the problem by restricting the import instead?

    Thread Starter wrip

    (@wrip)

    @birgire Not sure what you meant by “restricting the import”….

    You might check out the filter wp_import_posts, you can find it in /wp-content/plugins/wordpress-importer/wordpress-importer.php:

    /**
             * Create new posts based on import information
             *
             * Posts marked as having a parent which doesn't exist will become top level items.
             * Doesn't create a new post if: the post type doesn't exist, the given post ID
             * is already noted as imported or a post with the same title and date already exists.
             * Note that new/updated terms, comments and meta are imported for the last of the above.
             */
            function process_posts() {
                    $this->posts = apply_filters( 'wp_import_posts', $this->posts );
    
                    foreach ( $this->posts as $post ) {
                            $post = apply_filters( 'wp_import_post_data_raw', $post );
    
    // cut
Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Exporting selected pages to another WP website’ is closed to new replies.