• Resolved jrothra

    (@jrothra)


    Whenever I add a new product and save it (either as draft or publish it), WC adds “-2” to the end of the permalink. This happens even with brand new, never before included products. I can’t figure it out.

    For example, the other day I added this product: https://www.johnrothra.com/store/devotionals/hooked-on-jesus-2/

    Notice the URL is -2? I’ve never had a product called “Hooked on Jesus,” yet for some reason WC added the -2, and it does this every time.

    Anyone else encountered this and solved it? If so, what was the fix?

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

Viewing 8 replies - 16 through 23 (of 23 total)
  • Thread Starter jrothra

    (@jrothra)

    Tried creating a new product today. There is NO other product by that name. I’ve NEVER created a product by that name. Yet, WooCommerce is adding -2 again.

    This is starting to anger me!

    @woocommerce

    Thread Starter jrothra

    (@jrothra)

    @harishanker – you asked for the details. I provided it. Now you’ve gone silent, but the problem persists. What’s going on?

    • This reply was modified 6 years, 7 months ago by jrothra.
    Thread Starter jrothra

    (@jrothra)

    @riaanknoetze & @harishanker

    Y’all said, “The ‘-2’ is typically used to separate it from other posts with the same title (not necessarily products, it could be pages or blog posts as far as I know).”

    However, WC is adding this -2 to products even when there are NO posts, pages, or other products with the same name. So, that’s not the cause. For example, when I created “The Gospel in 1 Minute,” that title was completely unique to my site. Yet, WC added -2 to it because … well, I have no idea why.

    This is irritating and infuriating at this point.

    Erica K. a11n

    (@piratepenpen)

    Automattic Happiness Engineer

    Hey @jrothra – I’ve caught up on your thread and I have a question for you:

    When you have just Storefront and WooCommerce active, and you create a new product, does it still had -2 to your link? If you haven’t done this yet, please run a conflict test.

    If products are created normally with just those two things active, you have a conflict on your hands. Then slowly reactivate every plugin/theme and retest to see which is the culprit.

    If that doesn’t help, we’re going to need you to open a support ticket with us so that we can look into this further.

    Thread Starter jrothra

    (@jrothra)

    What is Storefront? Is it a theme or plugin? I use OceanWP for my theme.

    Thread Starter jrothra

    (@jrothra)

    I’ve tried countless tests, with and without all plugins deactivated (keeping WooCommerce only). The -2 still happened. It doesn’t occur all the time, though. If I create a product called, “This is my test product” then there’s no -2. However, when I use the actual titles, the -2 shows up.

    The only place I can find a hint of a possible conflict is with media. Here’s why: products include the following:

    Product Listing in the Store
    Product Image
    Sample Audio File

    The file name for each is different. For example, my latest product, “In Christ Alone”

    Product Listing
    File Name: n/a
    Title: In Christ Alone
    URL: https://www.johnrothra.com/store/devotionals/in-christ-alone-2/

    Product Image
    File Name: In-Christ-Alone-John-14-vv-1-7.jpg
    Title: In Christ Alone – John 14 vv 1-7
    URL: https://www.johnrothra.com/wp-content/uploads/2018/08/In-Christ-Alone-John-14-vv-1-7.jpg

    Sample Audio File
    File Name: In-Christ-Alone-John-14-vv-1-7-Sample.mp3
    Title: In Christ Alone
    URL: https://www.johnrothra.com/wp-content/uploads/2018/08/In-Christ-Alone-John-14-vv-1-7-Sample.mp3

    While the title of the audio file (which is not the same as the URL or file name) is the same as the product listing (which is in the URL), it shouldn’t be a conflict because (1) it’s media and (2) the URLs differ.

    For the one above, I uploaded the media files first. I’ll test by uploading them after creating a product name.

    • This reply was modified 6 years, 7 months ago by jrothra.
    Thread Starter jrothra

    (@jrothra)

    Okay, following your advice (except for Storefront), here’s what I discovered:

    Apparently the “Title” of the audio file (which is not the same as the file name or the URL) is causing the conflict. Here’s how I discovered it.

    Test 1
    Created a product called “First Sample Test Product JLR” (to ensure uniqueness). No -2 in the URL.

    I clicked “Add product image” and uploaded to files: an MP3 and a JPG (following the naming pattern described in my previous post). I put the JPG in the Product Image and added the MP3 to the short description. I clicked “Save draft” and the -2 showed up.

    Test 2
    As with test 1, I created the product, calling this one “Next Sample Test Product JLR.” However, I saved the draft before doing any media uploads. No -2 in the URL.

    I then opened the media library in a new tab and uploaded the JPG. Then added it to the Product Image and clicked “Save draft.” No -2 in the URL.

    I returned to the tab with the media library and uploaded the MP3. Going back to the product, I added the MP3 into the short description. I clicked “Save draft” and the -2 showed up.

    Thus, it seems the “Title” of the audio file (not the file name or the URL) is conflicting with the URL of of the product. This doesn’t make sense to me since the URL names are different.

    • This reply was modified 6 years, 7 months ago by jrothra.
    Plugin Support John Coy a11n

    (@johndcoy)

    Automattic Happiness Engineer

    Hi @jrothra,

    Thanks for letting us know. I’ll mark this thread as resolved for now as finding out that the issue was related to the title of the audio file.

Viewing 8 replies - 16 through 23 (of 23 total)
  • The topic ‘WooCommerce Adds “-2” in all Product URLs’ is closed to new replies.