Rank math primary cat to custom field

#901973
  • Resolved Alexandros Priovolos
    Rank Math free

    Hello team ,

    They ask me to export an xml with products and categories.
    But for categories, they want only 1.

    How can I export the full path of the primary category of a product to a custom field ?

    Thank you !

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello,

    We apologize for the issue you are facing. To export the full path of the primary category of a product to a custom field in Rank Math, you would typically need to use a combination of custom code or a plugin that allows for exporting product data along with custom fields. Unfortunately, the specific method to achieve this isn’t detailed in the provided context.

    However, you can consider the following general approach:

    1. Identify the Primary Category: Ensure that your products have a primary category set in the Rank Math settings.
    2. Custom Field Setup: Create a custom field in your product settings where you want to store the primary category path.
    3. Export Functionality: Use a plugin or custom code to handle the export process, ensuring it pulls the primary category data and formats it correctly for your XML export.

    If you need more specific instructions or assistance with coding, we recommend replying to this ticket, and a human agent from the Rank Math Support team will be able to assist you further.

    Thank you for raising this concern!

    Hello,

    Thank you for contacting support.

    Our plugin saves the ID of the primary product category inside the following key in the postmeta table: rank_math_primary_product_cat

    You can use that information to retrieve the ID via PHP custom code with the following function from WordPress: https://developer.wordpress.org/reference/functions/get_post_meta/

    If you want to export with the product list you can enable the option Export custom meta? in the product export section of WooCommerce products like so:
    Export

    Don’t hesitate to get in touch if you have any other questions.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)

The ticket ‘Rank math primary cat to custom field’ is closed to new replies.