Need help with Trimming/Removing words from title or description

#588495
  • Resolved Raw Videos
    Rank Math free

    Hello there,
    I am looking to trim/remove few set of stop words from title,
    For example my title is: Adipurush wallpapers Download Free
    rankmath modified title should be: Adipurush wallpapers

    I achieved this on a theme level by using some set of stop words being displayed on frontend, check sensitive data for more information.

    Similarly i want to use some stop words from being display on frontend.

    Share functions only in sensitive data.

    Thank you 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • Alhan
    Rank Math free

    Hello,

    Thank you for your query, and we are so sorry about the trouble this must have caused.

    If I understand your requirement correctly, you want to trim the words ‘free’, ‘download’, ‘movie’, ‘poster’ from your posts and pages title completely.

    We have a code for you that trims those words from the posts and pages titles when ever you save or update the particular post or page.

    This will allow you to save the posts and pages title without those words at all which will automatically reflect the same in the front end and back end as well at once.

    When it comes to the Meta Title from Rank Math SEO plugin, you can use the %title% variable to reflect the same trimed title there as well for you pages and posts.

    Please find the code in sensitive data section.

    If in case this is not what you were looking for, do let us know.

    We really look forward to helping you.

    Thank you.

    Hi,
    there’s small miscommunication, I meant title will be : “Adipurush wallpapers download free” and it will remain same and there should be no change.
    But in the rankmath plugin when using %title% it should trim and give desired output that is i will have set of of stop words like free, movie, etc…
    so for example original post title: Adipurush wallpapers download free
    rankmath meta title: Adipurush wallpapers download

    in the above free is listed in stop words.

    Hello,

    We don’t have a way to modify the %title% variable from our plugin but you can modify the output of the Rank Math meta title by using the following filter: https://rankmath.com/kb/filters-hooks-api-developer/#change-the-title

    You simply need to perform the checks and look for the presence of the stop words on the variable $title and then return it without those.

    The code you have in the sensitive data section should be easily pasted over to the filter we shared requiring minimal changes.

    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 3 replies - 1 through 3 (of 3 total)

The ticket ‘Need help with Trimming/Removing words from title or description’ is closed to new replies.