• Resolved cocool

    (@cocool)


    Hi,
    I have been using your plugin with success so far.

    The only settings I have set are in the PostTypes Permalinks Settings > Property =>
    property-paris/<%ctax_property_type%>/<%ctax_property_status%>/<%ctax_property_city%>/%title%/

    It now seems that the plugin automatically creates redirects for all new created posts/pages/categories/etc (even package or invoice). The PostTypes Permalinks
    are also systematically changed.
    This is very annoying because when I create a new page and want to create the translated version via WPML, the page has been redirected and I have to spend time to manually delete the redirect and re-set the correct (initial) slug (which can only be done through Quick Edit since when I change the slug on the page edit, it reverts back to the redirected slug).

    Does this have to do with the fact that I updated the plugin today?
    Is there a way to totally prevent the plugin from creating redirects or changing ALL PostTypes Permalinks?

    Another question: How can string set in the PostTypes Permalinks Settings be translated?
    Ex: translated: property-paris/<%ctax_property_type%>/<%ctax_property_status%>/<%ctax_property_city%>/%title%/
    to: immobilier-paris/<%ctax_property_type%>/<%ctax_property_status%>/<%ctax_property_city%>/%title%/

    Thanks a lot.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Sami Ahmed Siddiqui

    (@sasiddiqui)

    Hi Cocool

    Permalink changes according to defined structure till the post is not published so it provides the capability to not worrying about anything on changing the thing on your page.

    Redirect helps to not miss anything or prevent Google to report 404 on your site.

    If you want to disable auto-create redirects so, just add these filters:

    add_filter( 'permalinks_customizer_auto_created_redirects', '__return_false');
    add_filter( 'permalinks_customizer_disable_redirects', '__return_false');

    It now seems that the plugin automatically creates redirects for all new created posts/pages/categories/etc (even package or invoice)

    By the way, creating redirects for package and invoices are resolved in the latest release. If you are using the old version then there was an issue with it or maybe, redirects was created with the previous version which you just saw.

    Let me know, if anything else you want to know.

    Thanks,
    Sami

    Thread Starter cocool

    (@cocool)

    Hi Sami,

    Thanks for your prompt reply.

    Do I add the above 2 filters in the functions file in my child theme?
    Is there a way to also prevent the PostTypes Permalinks changes as well? This confuses the translation aspect.

    “By the way, creating redirects for package and invoices are resolved in the latest release”
    => I have just updated the plugin today and it still continues to creates redirectes for all types of posts, including invoices, packages, etc.

    Pls advice.
    Thanks

    Plugin Author Sami Ahmed Siddiqui

    (@sasiddiqui)

    Do I add the above 2 filters in the functions file in my child theme?

    Yes, both filters should be added

    Is there a way to also prevent the PostTypes Permalinks changes as well?

    No, there is no option for now. But will be added in upcoming release.

    I have just updated the plugin today and it still continues to creates redirectes for all types of posts, including invoices, packages, etc.

    Are you using WooCommerce? Does it custom PostTypes? As per my last testing, there is issue with order or so.

    Thread Starter cocool

    (@cocool)

    Hi Sami,

    I will add the code as recommended.

    No Woocommerce. the Template is Houzez from Favetheme.
    The theme indicates that the following are custom post types: Agents, Agencies, Houzez Packages, Houzez Invoices, Partners, Testimonials, User Packages Info.
    Can something be done?

    Also, can you please advice on how to translate strings set in the PostTypes Permalinks?
    Ex: translate: property-paris to immobilier-paris here:
    property-paris/<%ctax_property_type%>/<%ctax_property_status%>/<%ctax_property_city%>/%title%/

    Thanks!

    Plugin Author Sami Ahmed Siddiqui

    (@sasiddiqui)

    Ho cocool

    I will add the code as recommended.

    Have you added the code? Does it works as expected?

    Can something be done?

    Please exclude the PostTypes on which you don’t want the plugin to work on. You can do this by adding this code:

    function yasglobal_exclude_post_types( $post_type ) {
      if ( $post_type == 'page' ) {
        return '__true';
      }
      return '__false';
    }
    add_filter( 'permalinks_customizer_exclude_post_type', 'yasglobal_exclude_post_types');

    Change the page in the code with your PostTypes name to excluding to create the permalinks for.

    Also, can you please advice on how to translate strings set in the PostTypes Permalinks?

    Not sure about the translate strings in the PostTypes at the moment.

    Let me know, if you have any other question.

    Thanks,
    Sami

    Thread Starter cocool

    (@cocool)

    Thanks Sami,

    Yes the first code works well: no redirects at all.

    Can the code for post types be adapted to ALL post types? As at now absolutely every single post is given a post type permalink: properties, agents, attachments, invoices, packages, everything.
    If so, how to adapt the code above?

    As regards the translation can the custom words added before the tags simple be made as translatable in the plugin code?
    custom/<%ctax_property_type%>/<%ctax_property_status%>/<%ctax_property_city%>/%title%/

    Plugin Author Sami Ahmed Siddiqui

    (@sasiddiqui)

    Can the code for post types be adapted to ALL post types? As at now absolutely every single post is given a post type permalink: properties, agents, attachments, invoices, packages, everything.

    For excluding multiple PostTypes, please refer this example:

    function yasglobal_exclude_post_types( $post_type ) {
      if ( $post_type == 'invoices' || $post_type == 'packages' || $post_type == 'attachments' ) {
        return '__true';
      }
      return '__false';
    }
    add_filter( 'permalinks_customizer_exclude_post_type', 'yasglobal_exclude_post_types');

    Type as many PostTypes as you like to exclude here.

    As regards the translation can the custom words added before the tags simple be made as translatable in the plugin code?
    custom/<%ctax_property_type%>/<%ctax_property_status%>/<%ctax_property_city%>/%title%/

    I’ll try to provide another filter by which you can add the tranlatable tags from your functions.php code.

    Thanks,
    Sami

    Thread Starter cocool

    (@cocool)

    Thanks a lot Sami and apologies for this late reply.

    Any hint on the filter to add the translatable tags from the functions.php code?

    Thanks!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Constant Redirects’ is closed to new replies.