• Resolved eybel

    (@eybel)


    Hi there. I have an issue with permalinks.

    Let say the same product is in three different categories:

    parent/child-A/product

    and also:

    parent/child-B/product (same product)

    I have installed Yoast SEO Plugin and I picked “MAKE PRIMARY” does this change the permalink to for example child-A ?

    Because I did and for what I read in Yoast that only changes the breadcrumb but the permalink how is it managed?

    I am using woocommerce & Yoast SEO Free (so far).
    The URL that I provided it has “DOILIES” as the PRRIMARY category the URL permalink shows “WEDDING” which is a secondary category, like others that I also selected but I thought I would see “DOILIES” in the permalink. Both are same level categories. If I remove WEDDING, the permalink changes but I selected again it goes back to WEDDING, does an alphabetic order selection? I don´t know. I tried to select the primary category last but didn´t work either.

    Any idea?

    The page I need help with: [log in to see the link]

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

    The Primary Category feature is expected to only affect the breadcrumbs on the page. It will not change the permalink to show the primary category unless you have product_cat in your Settings-Permalink section. See image: https://pasteboard.co/IdBPVIT.png. We would like some more information.

    1. Can you confirm you have the right permalink set-up?

    2. Are all your non-Yoast plugins and themes also updated?

    3. Can you take a screenshot of your product categories section on https://www.linensartandthings.com/shop/products/wedding/white-lace-doily/? You can use a tool like: https://pasteboard.co/ to share the image.

    We are going ahead and marking this issue as resolved due to inactivity. If you require any further assistance please create a new issue.

    Thread Starter eybel

    (@eybel)

    Im here. Im checking

    Here is the screenshot of the shop permalink: https://pasteboard.co/IeOPTbk.png

    Here is the screenshot of my category section (is this what you wanted?): https://pasteboard.co/IeOQQZK.png

    My shop page URL in woocommerce is “shop”

    Yes all the relevant plugins are updated and I havent upgrade wordpres to 5.2 yet. I have previous version. (5.1.1)

    
    ### WordPress Environment ###
    
    WordPress address (URL): https://www.linensartandthings.com
    Site address (URL): https://www.linensartandthings.com
    WC Version: 3.6.2
    Log Directory Writable: ✔
    WP Version: ❌ 5.1.1 - There is a newer version of WordPress available (5.2)
    WP Multisite: –
    WP Memory Limit: 512 MB
    WP Debug Mode: –
    WP Cron: ✔
    Language: en_US
    External object cache: ✔
    
    ### Server Environment ###
    
    Server Info: Apache
    PHP Version: 7.2.14
    PHP Post Max Size: 512 MB
    PHP Time Limit: 600
    PHP Max Input Vars: 5000
    cURL Version: 7.29.0
    NSS/3.36
    
    SUHOSIN Installed: –
    MySQL Version: 5.6.35
    Max Upload Size: 512 MB
    Default Timezone is UTC: ✔
    fsockopen/cURL: ✔
    SoapClient: ✔
    DOMDocument: ✔
    GZip: ✔
    Multibyte String: ✔
    Remote Post: ✔
    Remote Get: ✔
    
    ### Database ###
    
    WC Database Version: 3.6.2
    WC Database Prefix: wp_
    MaxMind GeoIP Database: ✔
    Total Database Size: 34.18MB
    Database Data Size: 29.25MB
    Database Index Size: 4.93MB
    wp_woocommerce_sessions: Data: 0.46MB + Index: 0.01MB
    wp_woocommerce_api_keys: Data: 0.00MB + Index: 0.00MB
    wp_woocommerce_attribute_taxonomies: Data: 0.00MB + Index: 0.01MB
    wp_woocommerce_downloadable_product_permissions: Data: 0.00MB + Index: 0.00MB
    wp_woocommerce_order_items: Data: 0.02MB + Index: 0.01MB
    wp_woocommerce_order_itemmeta: Data: 0.09MB + Index: 0.07MB
    wp_woocommerce_tax_rates: Data: 0.00MB + Index: 0.01MB
    wp_woocommerce_tax_rate_locations: Data: 0.00MB + Index: 0.00MB
    wp_woocommerce_shipping_zones: Data: 0.00MB + Index: 0.00MB
    wp_woocommerce_shipping_zone_locations: Data: 0.00MB + Index: 0.01MB
    wp_woocommerce_shipping_zone_methods: Data: 0.00MB + Index: 0.00MB
    wp_woocommerce_payment_tokens: Data: 0.00MB + Index: 0.00MB
    wp_woocommerce_payment_tokenmeta: Data: 0.00MB + Index: 0.00MB
    wp_woocommerce_log: Data: 0.00MB + Index: 0.00MB
    wp_commentmeta: Data: 1.96MB + Index: 0.55MB
    wp_comments: Data: 0.12MB + Index: 0.02MB
    wp_et_bloom_stats: Data: 0.34MB + Index: 0.00MB
    wp_et_social_stats: Data: 0.02MB + Index: 0.00MB
    wp_facetwp_index: Data: 0.11MB + Index: 0.16MB
    wp_failed_jobs: Data: 0.00MB + Index: 0.00MB
    wp_gd_lightbox_settings: Data: 0.00MB + Index: 0.00MB
    wp_links: Data: 0.00MB + Index: 0.00MB
    wp_mailchimp_carts: Data: 0.00MB + Index: 0.00MB
    wp_options: Data: 6.39MB + Index: 0.21MB
    wp_pinterest_automatic: Data: 0.02MB + Index: 0.00MB
    wp_postmeta: Data: 10.97MB + Index: 2.03MB
    wp_posts: Data: 6.87MB + Index: 0.41MB
    wp_queue: Data: 0.00MB + Index: 0.00MB
    wp_redirection_404: Data: 1.02MB + Index: 0.64MB
    wp_redirection_groups: Data: 0.02MB + Index: 0.03MB
    wp_redirection_items: Data: 0.09MB + Index: 0.09MB
    wp_redirection_logs: Data: 0.16MB + Index: 0.08MB
    wp_revslider_css: Data: 0.09MB + Index: 0.00MB
    wp_revslider_layer_animations: Data: 0.00MB + Index: 0.00MB
    wp_revslider_navigations: Data: 0.00MB + Index: 0.00MB
    wp_revslider_sliders: Data: 0.01MB + Index: 0.00MB
    wp_revslider_slides: Data: 0.00MB + Index: 0.00MB
    wp_revslider_static_slides: Data: 0.00MB + Index: 0.00MB
    wp_smush_dir_images: Data: 0.09MB + Index: 0.06MB
    wp_taxonomymeta: Data: 0.00MB + Index: 0.00MB
    wp_termmeta: Data: 0.03MB + Index: 0.03MB
    wp_terms: Data: 0.01MB + Index: 0.04MB
    wp_term_relationships: Data: 0.11MB + Index: 0.26MB
    wp_term_taxonomy: Data: 0.02MB + Index: 0.02MB
    wp_usermeta: Data: 0.06MB + Index: 0.05MB
    wp_users: Data: 0.00MB + Index: 0.01MB
    wp_wc_download_log: Data: 0.00MB + Index: 0.00MB
    wp_wc_product_meta_lookup: Data: 0.09MB + Index: 0.09MB
    wp_wc_webhooks: Data: 0.00MB + Index: 0.00MB
    wp_yith_wcwl: Data: 0.00MB + Index: 0.00MB
    wp_yith_wcwl_lists: Data: 0.00MB + Index: 0.01MB
    wp_yoast_seo_links: Data: 0.02MB + Index: 0.02MB
    wp_yoast_seo_meta: Data: 0.06MB + Index: 0.00MB
    
    ### Post Type Counts ###
    
    attachment: 1221
    cpt_layouts: 9
    custom_css: 1
    customize_changeset: 50
    et_pb_layout: 7
    header: 1
    mc4wp-form: 2
    nav_menu_item: 139
    note: 1
    oembed_cache: 3
    page: 10
    post: 2
    product: 261
    product_variation: 344
    project: 1
    revision: 711
    scheduled-action: 44
    shop_coupon: 1
    shop_order: 47
    shop_order_refund: 1
    vc4_templates: 6
    
    ### Security ###
    
    Secure connection (HTTPS): ✔
    Hide errors from visitors: ✔
    
    ### Active Plugins (25) ###
    
    Premmerce Permalink Manager for WooCommerce: by premmerce – 2.1.9
    a3 Lazy Load: by a3rev Software – 1.9.2 – Not tested with the active version of WooCommerce
    Admin Custom Login: by Weblizar – 2.9.1
    Adminimize: by Frank Bültge – 1.11.4
    Bloom: by Elegant Themes – 1.3.10
    Custom Plugin for Code: by Abel Murua – 2.0.0
    Customer Reviews for WooCommerce: by ivole – 3.72
    Facebook for WooCommerce: by Facebook – 1.9.11 – Not tested with the active version of WooCommerce
    FacetWP - Load More: by FacetWP
    LLC – 0.4.3
    
    FacetWP: by FacetWP
    LLC – 3.3.7
    
    Monarch Plugin: by Elegant Themes – 1.4.12
    Redirection: by John Godley – 4.2.3
    Regenerate Thumbnails: by Alex Mills (Viper007Bond) – 3.1.1
    W3 Total Cache: by Frederick Townes – 0.9.7.4
    Widget Options: by Phpbits Creative Studio – 3.7.3
    WooCommerce Expand Tabs: by Diana Burduja – 1.10
    WooCommerce: by Automattic – 3.6.2
    Yoast SEO: by Team Yoast – 11.1.1 – Not tested with the active version of WooCommerce
    WP Dashboard Notes: by Jeroen Sormani – 1.0.9
    WP Mail SMTP: by WPForms – 1.4.2
    Wordpress Pinterest Automatic: by ValvePress – 4.11.2
    WP-ServerInfo: by Lester 'GaMerZ' Chan – 1.65
    Smush Pro: by WPMU DEV – 3.2.0.1
    Smush Pro: by WPMU DEV – 3.2.0.1
    WPMU DEV Dashboard: by WPMU DEV – 4.7.1
    
    ### Inactive Plugins (2) ###
    
    Elegant Themes Support: by Elegant Themes – 1.4
    Smush: by WPMU DEV – 3.2.0.1
    
    ### Dropin Plugins (3) ###
    
    advanced-cache.php: advanced-cache.php
    db.php: db.php
    object-cache.php: object-cache.php
    
    ### Settings ###
    
    API Enabled: ✔
    Force SSL: –
    Currency: USD ($)
    Currency Position: left
    Thousand Separator: ,
    Decimal Separator: .
    Number of Decimals: 2
    Taxonomies: Product Types: external (external)
    grouped (grouped)
    simple (simple)
    variable (variable)
    
    Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog)
    exclude-from-search (exclude-from-search)
    featured (featured)
    outofstock (outofstock)
    rated-1 (rated-1)
    rated-2 (rated-2)
    rated-3 (rated-3)
    rated-4 (rated-4)
    rated-5 (rated-5)
    
    Connected to WooCommerce.com: ✔
    
    ### WC Pages ###
    
    Shop base: #7536 - /home-decor/
    Cart: #6 - /cart/
    Checkout: #7 - /checkout/
    My account: #8 - /my-account/
    Terms and conditions: #6976 - /terms-and-conditions/
    
    ### Theme ###
    
    Name: Divi
    Version: 3.22.7
    Author URL: http://www.elegantthemes.com
    Child Theme: ❌ – If you are modifying WooCommerce on a parent theme that you did not build personally we recommend using a child theme. See: How to create a child theme
    WooCommerce Support: ✔
    
    ### Templates ###
    
    Overrides: –
    
    ### Action Scheduler ###
    
    Complete: 42
    Oldest: 2019-04-17 19:05:51 +0000
    Newest: 2019-05-08 19:06:52 +0000
    
    Pending: 2
    Oldest: 2019-05-15 19:06:52 +0000
    Newest: 2019-05-15 19:06:52 +0000
    
    Canceled: 0
    Oldest: –
    Newest: –
    
    In-progress: 0
    Oldest: –
    Newest: –
    
    Failed: 0
    Oldest: –
    Newest: –
    
    • This reply was modified 7 years, 1 month ago by eybel.
    • This reply was modified 7 years, 1 month ago by eybel.
    • This reply was modified 7 years, 1 month ago by eybel.
    Thread Starter eybel

    (@eybel)

    Here you have the premmerce settings (I also deactivated this but didnt change anything)

    https://pasteboard.co/IeOT2Rf.png

    I am using YoastSEO not woocommerce SEO yet.

    Thread Starter eybel

    (@eybel)

    SORRY BUT I HAVE REPLIED TO THE WRONG POST I FIXED THAT PERMALINK ISSUE BY PUTTING THE PRODUCT CATEGORY IN THE PERMALINK SETTINGS.

    In order to match the URL with the PRIMARY CATEGORY I have used this code:

    // FIX PERMALINK OF CATEGORIES MATCHING PRIMARY CATEGORY
    add_filter( 'wc_product_post_type_link_product_cat', function( $term, $terms, $post ) {
    
        // Get the primary term as saved by Yoast
        $primary_cat_id = get_post_meta( $post->ID, '_yoast_wpseo_primary_product_cat', true );
    
        // If there is a primary and it's not currently chosen as primary
        if ( $primary_cat_id && $term->term_id != $primary_cat_id ) {
    
            // Find the primary term in the term list
            foreach ( $terms as $term_key => $term_object ) {
    
                if ( $term_object->term_id == $primary_cat_id ) {
                    // Return this as the primary term
                    $term = $terms[ $term_key ];
                    break;
                }
    
            }
    
        }
    
        return $term;
    
    }, 10, 3 );

    NOW I AM FACING AN ISSUE WITH DUPLICATES URLS IN MY SITEMAP. (https://ww.wp.xz.cn/support/topic/duplicate-urls-in-yoastseo-sitemap-product_cat-sitemap-xml/)

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Same Product under Multiple Categories (wrong permalink)’ is closed to new replies.