Oxygen 4.0 is now available - see what's newlimited time special pricing available
Posted on September 2, 2022

How To Export and Import WordPress Categories and Tags

hello world!

In this article, we're going to show you how to export and import WordPress categories and tags, starting with a solid understanding of these two built-in taxonomies. We're also going to describe custom taxonomies and how to export and import them.

Here are the main section headings:

What are Taxonomies?

What are WordPress Categories and How are They Used?

What are WordPress Tags and How are They Used?

What are Custom Taxonomies and How are They Used?

How to Export WordPress Categories Separately From Posts

How to Export WordPress Tags Separately From Posts

How to Export WordPress Categories and Tags With Posts

How to Export WordPress Custom Taxonomies

Summary of Taxonomy Export Capabilities

How to Import WordPress Categories Separately From Posts

How to Import WordPress Tags Separately From Posts

How to Import WordPress Categories With Posts

How to Import WordPress Tags With Posts

How to Import WordPress Custom Taxonomies

Summary of Taxonomy Import Capabilities

Related Information

What are Taxonomies?

A taxonomy is simply a system of organizing information. Most people are familiar with this concept because of the taxonomies created for living organisms, such as this one for the gray wolf:

Grey Wolf Taxonomy

Source: https://biology-forums.com

As in this example, many taxonomies are hierarchal.

WordPress uses two main taxonomies: categories and tags. For added flexibility, it also supports custom taxonomies.

What are WordPress Categories and How are They Used?

Categories are the broadest way to group WordPress content and are usually hierarchal. For example, the National Football League (NFL) consists of two conferences, each split into four divisions with four teams per division:

WordPress Category Hierarchy Example

To create a website about this league, it would be natural to organize your site based on the league's structure:

NFC (conference)

NFC North (division)

Chicago Bears (team)

Detroit Lions (team)

Green Bay Packers (team)

Minnesota Vikings (team)

and so on...

All of these elements are good candidates for categories because even those at the lowest level — teams — may contain multiple posts that should be grouped together.

How are these categories used? When fans of the Chicago Bears visit your website, they can get all the information on their team simply by clicking the Chicago Bears category. If they want to access information on all the teams in the same division, they can go up one level in the hierarchy and click the NFC North category, and so on.

Without categories to organize your content, users would have to search your entire site to find related information.

Categories often represent the natural structure of a website and form key sections of its main menu.

What are WordPress Tags and How are They Used?

Tags provide alternative ways of grouping your content that are non-hierarchal and often more descriptive than categories. In our NFL example, we might add tags to identify teams by geographical region, such as West Coast, East Coast, and Central. Or we might use them to indicate the expansion year when a team joined the league, such as Pre-1970, 1970, 1976, 1995, 1999, or 2002.

Tags do not normally represent the natural structure of a website. For example, you wouldn't organize your NFL website based on a team's geographical region because that is not the way the league organizes itself. Nor is it the most common way that users expect the information to be organized.

However, some users may occasionally be interested in viewing your content this way. When this happens, it is very convenient for them to be able to simply click a tag like West Coast to see all the teams that are on the west coast.

A common way of presenting and interacting with tags is to use a tag cloud like this:

NFL Tag Cloud

 

In a tag cloud, the more a tag is used, the bigger its font. This helps users understand which tags are likely the most important.

Because categories typically reflect the natural way to organize a website (and there is usually only one way to do this), and tags represent multiple, alternative ways of viewing the same content, the average website has more tags than categories.

Another feature of tags is that they can be completely unrelated to each other. For example, there is no relationship between where a team is located and when it joined the NFL.

This freedom to use tags independently of each other has one main advantage and one main disadvantage when compared to categories. The advantage is flexibility: you can create tags for practically anything without having to reorganize your website or its menu system. The disadvantage is that, without the need to organize your tags, you may end up using too many of them and creating a giant tag mess.

What are Custom Taxonomies and How are They Used?

Custom taxonomies allow you to create a custom system of organization that is often specific to a topic, industry, or set of tasks.

For example, say that you've created a shipping plugin that is heavily dependent on the presence of a hierarchal definition of geographic locations such as Region, Country, State, and Zip or Postal Code. If you create these definitions using built-in categories, any modifications to them might harm your shipping plugin. By creating a custom taxonomy, you can completely control both its hierarchal structure and its values.

In other cases, you may not care about the individual values in your custom taxonomy but still require a specific structure. For example, if you create a cookbook plugin, you may want to ensure that every Recipe consists of at least one Ingredient and one Step, even if the values for all these custom categories are used-defined.

You can also create custom tags when you want to enforce the use of specific descriptions.

And keep in mind, we're not just talking about the taxonomies themselves in these examples. A plugin's entire workflow and key parts of its interface may depend on the structures and/or values of its custom taxonomies.

This explains why the most common use of custom taxonomies is to support plugin functionality.

WordPress Plugins

 

How to Export WordPress Categories Separately From Posts

For all walkthroughs, we're going to use a version of WP All Import that includes both import and export functionality. If you don't have access to this plugin, you can use this free online sandbox. Just choose the WooCommerce Store option and click Create Sandbox.

WP All Export automatically detects all categories for a WordPress website. Here are the steps needed to export them on their own:

Category Export Step 1: Create a New Export

Navigate to All Export › New Export:

New WordPress Category Export

 

  1. Select Specific Post Type.
  2. Choose Taxonomies.
  3. Select Categories.
  4. Click the blue Customize Export file at the bottom of this screen (not shown). This will bring you to the Drag & Drop interface.

Category Export Step 2: Configure the Export Columns

The Drag & Drop interface lets you configure your export columns.

All available data fields are listed in the Available Data section on the right. To include a data field  in the export, simply drag it from the Available Data section to the column selection area:

WordPess Category Export Column Selection

Most of the available category fields are listed in the Standard subsection, which is fully expanded in the preceding image.

As you can see, there is also a Media subsection. This contains the data fields typically associated with category images or thumbnails, namely:

  • URL
  • Filename
  • Path
  • ID
  • Title
  • Caption
  • Description
  • Alt Text
  • Featured

When you have finished selecting your export columns, click the blue Continue button at the bottom. This will bring you to the Export Settings screen.

Category Export Step 3: Confirm and Run Your Export

WordPress Category Export Settings

There are two sections in this screen:

  1. Scheduling Options. This section allows you to schedule your export either manually using cron jobs on your server, or by using WP All Export's Automatic Scheduling service, which lets you schedule your exports directly through the plugin's interface.
  2. Advanced Options. These options let you control many aspects of your export, including batch processing size, whether to break a large export into multiple output files, and whether to output only categories that have been modified since the previous export, which is a great option if you're trying to synchronize with external systems.

In this case, we'll leave both sections with their default settings and instead click the blue Confirm & Run Export button at the bottom.

Category Export Step 4: Download Your File

WordPress Category Export Confirm and Run

After your category export has finished running, you will see the screen shown above.

If you left the export type at its default setting of CSV, you just need to click the blue CSV button to download your export file, as indicated by the red arrow.

If you changed the export type to Excel or XML, this button will change to reflect your selected type.

As an alternative, you can generate a secure URL by clicking the blue Generate button. This URL will remain valid even if you later change the export file name.

And that's it! That's a simple example of how to export WordPress categories.

How to Export WordPress Tags Separately From Posts

The process of exporting WordPress tags separately from posts is identical to the process used to export categories, with one exception. At the beginning of the process, you simply choose an export type of Tags instead of Categories:

New WordPress Tag Export

 

From a process standpoint, that's the only difference!

How to Export WordPress Categories and Tags with Posts

From the user's perspective, the process of including WordPress categories and/or tags while exporting posts is no different than including any data element attached to posts: you simply drag the taxonomies that you want to export into the column selection area. The magic occurs under the hood because WP All Export recognizes that it is dealing with taxonomy fields and formats its export data accordingly. For instance, when exporting the categories associated with a post, WP All Export will output the entire category hierarchy in one field like this: "NFC>NFC North>Chicago Bears".

Why does it format the data this way? Because it makes it possible to correctly parse all the categories AND their hierarchal relationships when the data is used, which is exactly what WP All Import does when it imports this kind of data.

Let's walk through a quick example of the export process.

Post Export Step 1: Create a New Post Export

Navigate to All Export › New Export, but, this time, export a post type of Posts:

New WordPress Post Export

Post Export Step 2: Make Sure to Select Taxonomy Columns

When configuring your export columns in the Drag & Drop interface, expand the Taxonomies section in Available Data and drag your desired taxonomies into the column selection area. In the following example, we have selected both Categories and Tags.

Select Post Taxonomy Columns

 

Note how you do not get to select specific fields within these taxonomies. WP All Export will do that for you.

Post Export Step 3: Complete Your Post Export and Review the Export File

Finish your export, download your file, and open it in a spreadsheet application or other editor:

Post Taxonomy Export File

As you can see, the taxonomy data has been exported exactly as described earlier, i.e., with its hierarchal information intact.

How to Export WordPress Custom Taxonomies

One of the great things about WP All Export is that it standardizes a lot of exports that would otherwise require different procedures.

Such is the case with custom taxonomies. As our first example, let's look at exporting the custom product categories created by WooCommerce.

Custom Category Export Step 1: Create a New Export

Navigate to All Export › New Export:

New Product Category Export

As you can see, there's nothing different here. WP All Export automatically recognizes Product categories as a taxonomy. This lets you select it as your export target the same way you would the built-in Categories or Tags selections.

The same is true with selecting the export columns, as shown in this next step.

Custom Category Export Step 2: Configure the Export Columns

Product Category Columns

 

Look familiar? The only difference is the Term Meta section at the bottom of Available Data, which simply contains any additional fields associated with product categories that don't fit into the standard data model.

What about exporting product categories as part of a product export?

Product Export With Product Categories Step 1: Create a New Export

Navigate to All Export › New Export:

New Product Export

You start by selecting WooCommerce Products as your export type, which makes perfect sense.

But what's really convenient is that the plugin also recognizes the relationship between products and product categories so that it knows which fields to present in the column selection process.

Product Export With Product Categories Step 2: Select the Export Columns

Select Product Taxonomy Columns

If you click the green Preview button, you will see that WP All Export handles custom taxonomy hierarchies the same way, too:

Product Export Columns Preview

What About Custom Tags?

As you can probably guess by now, these are not a problem. WP All Export will automatically recognize custom tags the same way it does custom categories.

Summary of Taxonomy Export Capabilities

When working with WordPress taxonomies, it is important to know the differences between categories, tags, and custom taxonomies, as new WordPress users often get confused about these concepts and terms, which can lead to poor site design.

But when it comes to exporting taxonomies of any type, whether on their own or as part of another export, WP All Export really couldn't have made this any easier. You just have to master one basic process and let the plugin deal with any underlying differences.

How to Import WordPress Categories Separately From Posts

WP All Import automatically detects all WordPress categories. The challenge in importing them is mapping the incoming data elements to the correct WordPress fields. Here are the required steps:

Category Import Step 1: Create a New Import

Navigate to All Import › New Import:

New WordPress Category Import

  1. Upload your import file. You have many options here, including using an existing file (i.e., already uploaded) or downloading a file from either a URL or FTP/SFTP site.
  2. Choose New Items > Taxonomies. This will open up a second drop-down selection box.
  3. Choose Categories in the second selection box.
  4. Click the blue Continue to Step 2 button.

Category Import Step 2: Review the Import File

New Category Import Review Import File

The purpose of this step is to verify that your import data has been correctly parsed. Most times, no adjustments are required. Still, this verification is important because, if a parsing problem does occur, it will likely cause serious errors during the import.

When your verification is complete, click the Continue to Step 3 button.

Category Import Step 3: Map the Incoming Data to the Target Category fields

This interface lets you tell WP All Import where to apply the incoming data:

WordPress Category Import Drag and Drop 1

The mechanics of the interface are simple: you just drag the incoming data element to the appropriate target field.

The key is to know which fields to target. This is relatively simple when it comes to WordPress categories. If the incoming category data does not contain any hierarchal categories or images, the above mapping is all that is required. The termname incoming element becomes the category name, and the term slug will get automatically generated as part of the import.

However, if the data does contain hierarchies, you will need to scroll down, expand the Other Category Options section, and map the incoming parentname data element to the Parent Term field, as shown here:

WordPress Category Import Drag and Drop 2

WP All Import will use this information to recreate the category hierarchies during the import.

Click the Continue to Step 4 button to continue.

Category Import Step 4: Configure the Category Import Settings

WordPress Category Import Settings

Here are the actions you need to take in this screen:

  1. Create a unique identifier for each incoming record by clicking the Auto-detect button. Using the same unique identifier for each subsequent run of the same import helps WP All import identify new categories, duplicates, etc., in an updated file.
  2. Here, you can set specific instructions for how the plugin should behave if the import is run again. Some of the issues addressed in these settings include whether to add new categories when new records appear in the import file, whether to delete existing categories if they are no longer present in the file, and how to update existing categories that remain in the file. Note, these settings only apply if you run the same import again, presumably with an updated version of the import file.
  3. Click Continue.

Category Import Step 5: Confirm and Run the Import

The import Confirm and Run screen provides a more complete summary of what will occur during the import process than does its export counterpart:

WordPress Category Import Confirm and Run

As with the Review Import File screen, you seldom have to take any actions in response to this screen. But it is still good practice to scan the Import Summary to verify that the import will do what you expect.

Once you've confirmed this, click the Confirm & Run Import button.

The import will run. When it completes, you will see this confirmation screen:

Import WordPress Categories Import Complete

If you look closely at the messages at the top, the second message indicates that one of the import records was skipped. This is because it contained the Uncategorized category, which is already present by default in every WordPress install.

Otherwise, the import was a success!

How to Import WordPress Tags Separately From Posts

We're not going to show you the entire process for importing WordPress tags separately from posts because it is nearly identical to importing categories. At the start of the process, the only difference is that you must select Tags as the taxonomies import subtype, not Categories:

New WordPress Tag Export

After that, the remaining differences are:

  1. You typically only have to worry about tag names.
  2. You don't have to deal with hierarchies.

How to Import WordPress Categories With Posts

This is where things start to get a bit more complicated. You have already seen an example of the basic import process, which depends mainly on the user mapping incoming data elements to the appropriate target fields. For a more in-depth description of this process, see How to Import Any CSV, XML, or Excel File into WordPress.

Importing posts follows the same process. Our area of focus for this article is the Taxonomies, Categories, Tags section in the Drag & Drop interface:

Import WordPress Categories With Posts

As you can see from this image, when you expand the Taxonomies, Categories, Tags section, you are presented with two options: Categories and Tags.

Here's what happens when you select Categories:

Import WordPress Categories With Posts Initial Options

You are now presented with these four options:

  • Each Post has just one Category
  • Each Post has multiple Categories
  • Posts have hierarchal (parent/child) Categories (i.e. Sports > Golf > Clubs > Putters)
  • Enable Mapping for Categories

Here is how to make the correct choice in this example:

  1. If you look at the breakdown of the incoming data elements in the upper right section of the screen, you will see that the content of the categories data element contains the value "NFC>NFC North>Chicago Bears". This indicates that the incoming category structure is hierarchal.
  2. Therefore, the Posts have hierarchal (parent/child) Categories (i.e. Sports > Golf > Clubs > Putters) option seems like the best fit.

When you select the Posts have hierarchal (parent/child) Categories (i.e. Sports > Golf > Clubs > Putters) option, you are presented with additional options:

Import WordPress Categories With Posts Final Options

  1. The best fit out of these additional options is An element in my file contains the entire hierarchy (i.e. you have an element with a value = Sports > Golf > Clubs > Putters), so you should check this. When you do this,  another set of options opens up, including a blank field.
  2. Drag and drop the incoming categories element into the blank field.

These actions simply declare that, "My incoming categories are in a data element called categories, and they are hierarchal."

However, there is a much broader point here. There are a lot of options and sub-options in this process. That's because category data may be embedded in post data in many different ways. WP All Import addresses all of these potential incoming data structures while also allowing you complete flexibility in deciding how to handle those structures.

How do you know which options you should use and how to make the correct decisions? That's why WP All Import has written such extensive documentation (see the Related Information section at the bottom). If you're still unsure, just contact their support department.

How to Import WordPress Tags With Posts

The process of importing WordPress tags with posts is nearly identical to that of importing categories with posts, though a bit simpler:

Import WordPress Tags With Posts Options

  1. Check your incoming data, where you should a) see tag data present, and b) after perusing a few records, you should be able to determine if you are dealing with a single tag or multiple tags per post.
  2. Select the Tags option.
  3. Drag and drop the incoming tags element (or whatever it may be called) to the blank field under Each Post has just one Tag option, which appears to be suitable for this incoming dataset.

As you can see, there are also options for posts with multiple tags, or you can enable mapping for tags, which allows you to treat incoming values as different tags based on your mapping rules.

Again, the point is that WP All Import has thought all this out in advance so that you can handle almost any scenario in which tags are attached to posts.

The rest of the import process is identical to that of earlier examples.

How to Import WordPress Custom Taxonomies

Importing WordPress custom taxonomies on their own is the same as importing any other taxonomy on its own.

For example, to import WooCommerce product categories, you simply choose Product categories as the Taxonomies subtype, and the rest should be completely familiar to you. As with any other taxonomy import, you just have to be aware that product categories are usually hierarchal.

Much the same can be said for importing custom taxonomies with custom post types. The general process itself doesn't differ from importing, say, built-in taxonomies with WordPress posts. But you do have to be intimately familiar with the custom entities in question.

For example, if you're importing WooCommerce product categories as part of a product import, the taxonomy portion of the import is going to look very similar to the example we showed you in the How to Import WordPress Categories With Posts section:

Import WooCommerce Product Categories With Products

But if you're dealing with a different custom taxonomy and custom post type, you may find yourself needing one of the many taxonomy import options that we haven't explored in this article.

Summary of Taxonomy Import Capabilities

As the preceding sections have demonstrated, importing taxonomies can be much more complex than exporting them. Then again, that's true of any import vs export comparison. After all, WP All Export is aware of everything in the WordPress database. It isn't reliant on the user to help figure it out.

This isn't the case with imports, as import data might be in any format. It may even require translation from one set of terms to another on the fly.

All WP All Import can do when facing these unknowns is to arm you with the options that you need to manage them, which is exactly what it does.

Export WordPress Categories, Tags, and Custom Taxonomies - Plugin Description

Import WordPress Categories, Tags, Brands, and more - Plugin Description

How to Export WordPress Categories and Tags

Export Posts With Their Taxonomies

How to Import WordPress Categories and Tags

Nested, Hierarchical Taxonomies

Taxonomy Meta & Images

How to Export WooCommerce Orders and Products

How To Import and Export Advanced Custom Fields (ACF) Data

Leave a Reply

Your email address will not be published. Required fields are marked *

Get Oxygen Today

Lifetime, unlimited site license

Copyright © 2022 Soflyy
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram