• Resolved yumsun

    (@yumsun)


    Hi,

    YoastSEO does not output the custom URLs added by rewrite_rules_array.
    I hope you have some good ideas.

    I’ve added the following URL
    I added post_type to the URL of the taxonomy term archive to display articles filtered by post type. There is no problem showing this archive.

    
    function com_url_rewrite_rules($rules) {
        $add_rules = array();
        $add_rules['products/page/([0-9]+)/?'] = 'index.php?&paged=$matches[1]&post_type=products';
        $add_rules['products/([^/]+)/([^/]+)/page/([0-9]+)/?'] = 'index.php?taxonomy=$matches[1]&term=$matches[2]&paged=$matches[3]&post_type=products';
        $add_rules['products/([^/]+)/([^/]+)/?'] = 'index.php?&taxonomy=$matches[1]&term=$matches[2]&post_type=products';
    
    add_action('rewrite_rules_array', 'com_url_rewrite_rules');
    

    YoastSEO is unable to call the taxonomy template, resulting in an error.
    The error is below:
    Admin only notice: this page does not show a meta description because it does not have one, either write it for this page specifically or go into the [SEO – Search Appearance] menu and set up a template.

    I figured that if there was a filter or something that could call SEO template as an archive for a term, even if both taxnomy and post_type are set, it would be possible.

    Best regards,
    yumsun

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Michael Ti?a

    (@mikes41720)

    Hi @yumsun

    We’re sorry but we can’t offer support on custom code. Since we don’t want to take the risk that we break your website by suggesting incorrect or incomplete code, we cannot advise you on this or how to make changes to it.

    Yoast SEO includes filters that allow you or your developer to customize many of our plugin features. These filters are documented inside the plugin code. We also have a developer portal where you can find more information about filters and even check out some examples of how to use them – https://developer.yoast.com/

    Unfortunately, there’s a difference between the support we can offer and the level of programming needed to change (core) features of our plugin. Since we don’t want to take the risk that we break your website by suggesting incorrect or incomplete code, we cannot advise you on how to make such changes. And even though we cannot be of any assistance, you’re completely free to change anything in the plugin to better suit your needs.

    Maybe someone watching these forums can assist you further, but if your topic is inactive for 7 days, we’ll mark it as resolved to keep the overview.

    Thanks for your understanding.

    Thread Starter yumsun

    (@yumsun)

    Hi @mikes41720,

    I think you are right.
    I’ll look into how to customize it somehow.
    Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘rewrite_rules_array and YoastSEO’ is closed to new replies.