Snippet Description – unable to target my variables

#462907
  • Resolved Ian
    Rank Math pro

    2 questions:

    1. I’m trying to build out the Description part of a Job Posting Snippet using %% variables in Titles & Meta in RankMath (my website is based on a job board prebuilt theme that I imported).

    I can target the job title variable using %title% but I can’t work out how to target data that I’ve input to the job post using fields that are part of the job board theme for example:

    – Salary
    – Type (ie full time/part time etc)
    – Expiration Date
    – Company Name

    I’d like to have these available so I can use them in the snippet description without having to type them manually each time.

    The job board theme builder has said:

    In our theme selectable fields (e.g. Type) are stored as taxonomy terms of “hp_listing_fieldnamehere” taxonomy, while non-selectable fields like Salary are stored as “hp_fieldnamehere” post meta fields. Listing itself is a custom post type “hp_listing”.

    I’ve tried these (for example: hp_listing_salary as per format above) but the data still doesn’t pull through.

    The theme builder has suggested asking RankMath to see:

    if they allow accessing post meta fields this way

    Can you help guide me with this please.

    2. Assuming this is doable would I be able to use the same variables in the Job Posting Schema Generator?

    Thanks for your help in advance.

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

    Thank you for contacting Rank Math support, and sorry for any inconvenience that might have been caused due to that.

    1. You can use our variable %customfield(YOUR_FIELD_NAME)% to retrieve the value of a certain custom field. Assuming the custom field is created using WordPress standard, Rank Math should be able to read it and displays it on the frontend.

    2. Yes, the %customfield(YOUR_FIELD_NAME)% variable should also work in your schema fields.

    Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.

    Ian
    Rank Math pro

    Thank you, I’ve managed to get one of the variables to work but not the others. I’ve gone back to the theme builder for confirmation on their variables and will come back to you if any other questions.

    Anas
    Rank Math business

    Hello,

    Let us know how it goes.

    Meanwhile, if you have any questions, please feel free to ask.

    We are here to assist you.

    Ian
    Rank Math pro

    Hi,

    Some follow up questions.

    In quotes below below are the comments back from the theme builder, the questions for you are in bold.

    “Selectable attributes are stored as taxonomy terms (not as meta fields), please ask them if they have a variable for this.

    Company is another post type set as a parent post for each listing, please ask them if they have a variable of showing the parent post title.

    Hoping you can help further with this please.

    Nigel
    Rank Math business

    Hello,

    For both questions you would have to create custom variables with code. You can use the following guide for how to do it: https://rankmath.com/kb/variables-in-seo-title-description/#how-to-add-custom-variables

    Hope that helps. Please let us know if you have questions.

    Ian
    Rank Math pro

    Great, thanks for your help, I’ll give it a go.

    Hello,

    Glad that helped.

    Please feel free to reach out to us again in case you need any other assistance.

    We are here to help.

    Thank you.

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

The ticket ‘Snippet Description – unable to target my variables’ is closed to new replies.