Which field in the setting sets data in Snippet

  • Hi Support,

    I’ve spent many hours to understand from which field Snippet reads data.

    When I click Edit Snippet it opens and has 3 boxes, in the second box there is field with this hint:

    “This is the unique URL of this page, displayed below the post title in the search results.”

    It always gets the data from the address in the listing. I could not find such a field in the Listing section.
    Please advise.

    Thank you,

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

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

    Screenshot

    The first field on the above screenshot is derived from the post title and you can also set a manual title. The second one is the permalink and this will be generated from the post permalink on the page while the third represents the meta description.

    Looking forward to helping you. Thank you.

    ​​​​​​​

    Hi Support,

    Thank you for the reply.

    I’d like to know where in the setting I can find these fields to change the parameters?

    1- I have a directory listing website and for each new listing RankMath grabs “address + site_title” in the second field. I should change it to the permalink only

    2- For the third field which reads from the description of the listing, if there is an enter after the first line it does read the rest of the lines after that. So it only shows the first line of the paragraph.

    Thank you for your time and support.

    Hi Michael, is there any update on this one?

    Hello,

    Thank you for contacting Rank Math today and sorry for the delay.

    You can configure the global settings for the listings post type by heading over to:
    Rank Math > Titles & Meta > Select Listings on the tabbed section

    You will then be able to configure the variables that will be used for the title & description.

    Looking forward to helping you. Thank you.

    ​​​​​​

    Hi Michael,

    Thank you for the update.. in Listing -> “Single Listing Description” there is
    “%title% %sep% %excerpt% ” I’d like to have the entire listing description not %excerpt%

    I tried all parameters there but none of them were what I’m after. I tried to use %customfield(description)% but that did not work either.. What needs to be done to fix that?

    Hi Hanif,

    I am not sure what you are trying to do.

    Where should that description be grabbed from?

    Hi Todd,

    I’ve taken a screenshot for clarification, please have a look at it here:
    RankMath

    Thank you,
    Hanif

    Hello,

    Thank you for contacting Rank Math today.

    You can use the following filter to write some code to generate the meta description from the post content:

    /**
     * Allow changing the meta description sentence from within the theme.
     *
     * @param string $description The description sentence.
     */
    add_filter( 'rank_math/frontend/description', function( $description ) {
    	return $description;
    });

    Looking forward to helping you. Thank you.

    ​​​​​​

    Hi Michael,

    Thank you for that… I’m not sure where to add the code?

    I read the below post as well but it’s not mentioned on which file code should be inserted
    https://rankmath.com/kb/filters-hooks-api-developer/

    Thank you.

    Hi Hanif,

    That code needs to be placed in your theme’s function.php file.

    To keep the meta description meaningful, Rank Math auto-generates the meta from your content by only using the first paragraph. You can change your first paragraph accordingly to have it used as your meta description.

    Moreover, the code we provided you above is just the basic filter. You have to know a bit of coding to make it work as you intend.

    Do let us know if that helps.

    Hi Todd,

    I added “add_filter( ‘rank_math/frontend/description’, function( $description ) {
    return $description;”

    To my functions.php however %discription% field is not showing up on

    “Single Listing Description”

    Any idea?

    HI Hanif,

    Thanks for the follow up.

    As we mentioned earlier this code won’t work on its own, you have to customize it further to get the value from the content.

    I can suggest that you reach out to your developer so that they can help with this customization.

    Thank you.

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

You must be logged in to reply to this ticket.