• Resolved Ivaylo Tinchev

    (@itinchev)


    Hello,

    I am trying to use the following hooks to modify the content for the twitter card title and description:

    rank_math/opengraph/twitter/title
    rank_math/opengraph/twitter/description

    Unfortunately it does not seem to work. Can you please check?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Rank Math Support

    (@rankmathteam)

    Hello @itinchev,

    Thank you for contacting the support.

    You are not using the correct properties. Please use the following filters:

    rank_math/opengraph/twitter/twitter_description
    rank_math/opengraph/twitter/twitter_title

    Hope that helps. Let us know if you need any other assistance.

    Thread Starter Ivaylo Tinchev

    (@itinchev)

    Hello @rankmathteam,

    Thank you for your support!

    Those have probably changed in the past because I remember using them before as described in my first post and they worked. By the way, the code in your website uses the image part of the hook without the twitter_ part in front of it. Here is the code for OpenGraph filters listed on the following page https://rankmath.com/kb/filters-hooks-api-developer/:

    /**
     * Allows developers to change the OpenGraph image within theme.
     *
     * The dynamic part of the hook name. $network, is the network slug. Can be facebook or twitter.
     *
     * @param string $attachment_url The image we are about to add.
     */
    add_filter( "rank_math/opengraph/{$network}/image", function( $attachment_url ) {
    	return $attachment_url;
    });

    IMHO, it will be good to have a page with all of your up-to-date Rank Math SEO hooks described “one per line” as other products have theirs. And then the examples of use.

    Thanks again!

    Plugin Support Rank Math Support

    (@rankmathteam)

    Hello @itinchev,

    Glad that helped.

    We have forwarded your suggestion to the concerned team and they will look into this.

    Thank you so much and don’t hesitate to get in touch in case you need our assistance with anything else.

    We are here to assist.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Twitter title and description hook do not work’ is closed to new replies.