rank_math/frontend/title & add_rewrite_rule do not work

#25850
  • Resolved Kasper Stück
    Rank Math free

    Hi,

    add_rewrite_rule(‘^page/([^/]*)/?$’, ‘index.php?page_id=20&page_category=$matches[1]’, ‘top’);

    Do not work on page/category pages.
    add_filter(‘rank_math/frontend/title’, static function () use ($name) {
    return $name . ‘ Page’;
    }, 10, 1);

    Thanks.

    • This topic was modified 4 years, 10 months ago by Kasper Stück.
Viewing 15 replies - 1 through 15 (of 16 total)
  • Hello,

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

    I have just tested this on my end and the filter works as expected on category pages. The rewrite rule also works as well.

    Could you please create a vanilla test WP installation and check if the issue will still be reproduced?

    Looking forward to helping you. Thank you.

    ​​​​​​​

    Ahh can see it is because I use:
    add_action(‘parse_request’, [$this, ‘parse_request’]);

    function parse_request:
    require_once plugin_dir_path(__FILE__) . ‘/templates/page_template.php’;
    die();

    Hello,

    We are super happy that this resolved your issue. If you have any other questions in the future, know that we are here to help you.

    If you don’t mind me asking, could you please leave us a review (if you haven’t already) on https://wordpress.org/support/plugin/seo-by-rank-math/reviews/?rate=5#new-post about your overall experience with Rank Math? We appreciate your time and patience.

    If you do have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.

    Thank you.

    It dont work because of this part og the code:

    add_action(‘parse_request’, [$this, ‘parse_request’]);

    function parse_request:
    require_once plugin_dir_path(__FILE__) . ‘/templates/page_template.php’;
    die();

    Hello,

    Thank you for contacting Rank Math today.

    I have just raised this issue with our dev team and we will be getting back to you in a short while.

    Looking forward to helping you. Thank you.

    ​​​​​​

    Hello,

    Can you please give us some more details of the issue?

    Looking forward to helping you. Thank you.

    What do you need to know ?

    Dont work
    add_filter(‘rank_math/frontend/title’, static function () use ($name) {
    return $name . ‘ Page’;
    }, 10, 1);

    Then use:
    add_rewrite_rule(‘^page/([^/]*)/?$’, ‘index.php?page_category=$matches[1]’, ‘top’);

    add_action(‘parse_request’, [$this, ‘parse_request’]);

    function parse_request:
    require_once plugin_dir_path(__FILE__) . ‘/templates/page_template.php’;
    die();

    Todd
    Rank Math free

    Hello,

    This filter:
    add_filter(‘rank_math/frontend/title’, static function () use ($name)

    It is used to change a page’s title.

    We are not sure how the other one relates to this. Is this even related to Rank Math?

    What exactly are you trying to do?

    Change the title? But it is not wokring.

    If i use rank_math/frontend/title it just show the page name.

    If i use Yoast SEO wpseo_title filter, it works.

    Hello,

    Can you please add your site’s admin access and the link of the page in the Sensitive Data Section?

    Looking forward to helping you. Thank you.

    Hello,

    I have updated the sensitive data as requested. Can you please check further?

    Thank you.

    Hello,

    In which file have you added the rank math filter code? I don’t see any filter code in functions.php file.

    Looking forward to helping you. Thank you.

    In the plugins i have write in the Sensitive Data

    Todd
    Rank Math free

    Hi Karper,

    That tag needs to be present in your theme’s functions.php file for it to work.

    Have you tried that?

    No, but it works with Yoast SEO!

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

The ticket ‘rank_math/frontend/title & add_rewrite_rule do not work’ is closed to new replies.