Skip to main content
All CollectionsCustom Post Types
Adding custom taxonomies to the created pages
Adding custom taxonomies to the created pages

Next to the default categories, you can use any taxonomy you want with LPagery

Jonas Lindemann avatar
Written by Jonas Lindemann
Updated over 2 months ago

In addition to the default categories, LPagery allows you to add any custom taxonomy to your generated pages. This feature gives you more flexibility in organizing your content, whether you're using hierarchical or non-hierarchical taxonomies.

This feature is available for the LPagery Extended plan and above.
Click here to purchase LPagery Pro ->

Make sure you have enabled your custom post type in the Settings so you can use your template page of your custom post type with the custom taxonomies.
Read here to see how: Use custom post types as template page


How to Add Custom Taxonomies

Custom taxonomies can be assigned to your created pages in two ways:

  1. Using the settings when creating the pages

  2. Directly via the source file


Option 1: Add Custom Taxonomies via the Page Creation Settings

If you prefer not to use the source file, you can also add custom taxonomies during the page creation process through the LPagery interface.

Steps:

  1. Select a Custom Post Type:
    When creating pages, choose a custom post type in the settings. Once selected, LPagery will automatically display the relevant input fields for any custom taxonomies associated with the selected post type.

  2. Assign Taxonomy Values:
    After choosing a template page from a custom post type with custom taxonomies, LPagery will automatically display a field for every taxonomy associated with the custom post type. Just select the one you want to assign to the created pages by clicking on it.


Example Workflow:

  • Select Custom Post Type: Suppose you're working with a post type called "Locations."

  • Choose Taxonomies: If "Locations" has associated taxonomies like "Region" or "Category," these will automatically appear as input fields in the creation settings.

  • Assign Values: You can then assign values like "North America" for "Region" or "Tourist Spot" for "Category" directly within the LPagery interface.


Option 2: Add Custom Taxonomies via the Source File

To add custom taxonomies through the source file, specify them in the following format in the column header:
lpagery_taxonomy_{taxonomy_name}

Replace {taxonomy_name} with the slug of your custom taxonomy. Taxonomies can be single or multiple, and they can also be hierarchical or non-hierarchical, similar to categories and tags.

Examples:

  • Single Taxonomy Value:
    For a non-hierarchical taxonomy like "region":
    lpagery_taxonomy_regionnorth-america

  • Multiple Taxonomy Values:
    Separate values with | for multiple taxonomies:
    lpagery_taxonomy_regionnorth-america|europe

  • Hierarchical Taxonomy Values:
    Use > to define the hierarchy, e.g.:
    lpagery_taxonomy_regionnorth-america>usa>california


Example: Adding Custom Taxonomy to Your Source File

In your source file (CSV, XLSX, or Google Sheet), create a new column with the header as lpagery_taxonomy_{taxonomy_name}. Fill in the values for each row, depending on the taxonomy you want to assign to each page.

Example Source File:

service

city

lpagery_taxonomy_region

lpagery_taxonomy_topic

Window Cleaning

Manhattan

region1>subregionA

topic1|topic2

Floor Cleaning

Brooklyn

region2>subregionB

topic2

Ceiling Cleaning

Queens

region1>subregionC

topic1


Using Dynamic Placeholders in Taxonomy Values

You can also use dynamic placeholders in your custom taxonomy values, allowing the taxonomies to change based on the data from your source file. This makes the page generation process even more flexible.

Example with Dynamic Placeholders:

service

city

lpagery_taxonomy_service

lpagery_taxonomy_location

Window Cleaning

Manhattan

{service}

{city}

Floor Cleaning

Brooklyn

{service}

{city}

Ceiling Cleaning

Queens

{service}

{city}

In this case, LPagery will replace the {service} and {city} placeholders with the corresponding values from each row of your source file.

Generated Results:

  • Page 1 will have the taxonomy value: Window Cleaning for lpagery_taxonomy_service and Manhattan for lpagery_taxonomy_location.

  • Page 2 will have the taxonomy value: Floor Cleaning for lpagery_taxonomy_service and Brooklyn for lpagery_taxonomy_location.

  • Page 3 will have the taxonomy value: Ceiling Cleaning for lpagery_taxonomy_service and Queens for lpagery_taxonomy_location.


By using custom taxonomies with LPagery, you can better organize your generated content, making it easier to manage and navigate, especially if you're working with complex content structures. This feature allows for more precise content categorization, improving the overall functionality of your WordPress site.

Did this answer your question?