404 pages are not redirected

#599954
  • Resolved Giuliano Ciolino
    Rank Math free

    Hi, I’ve discovered that mine tags are bugged. Error 404. I’ve disabled all plugins and changed them, but I’ve same troubles.

    I’ve tried using Rank Math redirects, but it doesn’t fix.

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

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

    Can you please share the affected URL with us so we can further check it on our end?

    Also, please clear your website cache and flush the permalinks by heading over to your WordPress Dashboard > Settings > Permalinks and clicking on save without changing anything.

    See if that improves the situation.

    Looking forward to helping you.

    You still haven’t implemented the tag without /tag/ in the url. I had asked last year to fix the problem. Meanwhile I wait, put /tag/in the url.

    Hello,

    At the moment, our plugin doesn’t have the option to remove the /tag/ base and we currently don’t plan on adding said option.

    With that said, you may refer to other plugins that can support removing the /tag/ base from the URL.

    We apologize for the inconvenience.

    Please do not hesitate to let us know if you need our assistance with anything else.

    Thank you.

    🙁

    Alhan
    Rank Math free

    Hello,

    To remove the /tag/ base manually, you will have to add custom hook/filter codes to your functions.php file.

    Ensure you flush your rewrite rules by visiting and saving changes without making any changes at Settings > Permalinks in your WordPress backend.

    add_action('init', 'custom_tag_base');
    function custom_tag_base() {
        global $wp_rewrite;
        $tag_base = ''; // Set your tag base here, for example: 'topic'
        $wp_rewrite->add_rewrite_tag("%tag%", '([^/]+)', "tag=");
        $wp_rewrite->add_permastruct('post_tag', $tag_base . '/%tag%', false);
    }
    
    add_filter('term_link', 'custom_term_link', 10, 3);
    function custom_term_link($termlink, $term, $taxonomy) {
        if ($taxonomy !== 'post_tag')
            return $termlink;
        return str_replace('/tag', '', $termlink);
    }
    
    add_filter('tag_row_actions', 'fix_tag_link', 10, 2);
    function fix_tag_link($actions, $tag) {
        $actions['view'] = '<a href="' . home_url() . '/' . $tag->slug . '" target="_blank">View</a>';
        return $actions;
    }

    Here’s how you can add filter/hook to your WordPress site:
    https://rankmath.com/kb/wordpress-hooks-actions-filters/

    Ensure you flush your rewrite rules by visiting and saving changes without making any changes at Settings > Permalinks in your WordPress backend.

    Remember that if you have any problems or if something breaks, remove the code and consult with a developer.

    We hope that helps, and please don’t hesitate to get in touch if you have any other questions.

    Thank you.

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

The ticket ‘404 pages are not redirected’ is closed to new replies.