• Resolved xtensions

    (@williamews)


    Hello… Not able to edit or add products to Woocommerce… When I click on “Add New” under “Products” menu, it redirects and throw 404 error… We thought it may be ModSecurity causing the issue, but even after whitelisting and disabling some Rules in ModSecurity, it did not resolve the issue.

    Any suggestions?

    Thank you

Viewing 13 replies - 1 through 13 (of 13 total)
  • Hey there, @williamews! Thanks for contacting us. I’m happy to help you.

    Have you tried a different browser/device/internet connection?

    Is this a new occurrence on an established site, or is this a new site where you’re facing the issue for the first time?

    Are you facing a 404 error on any other page in the WP Admin dashboard? Could you please verify this by checking a few other admin pages?

    After attempting an update and landing on the 404 error page, what is the URL in your browser’s address bar?

    Can you please run a conflict test to see if something external is interfering with this?

    To test, you’ll first want to change the theme on your site to Storefront, then check to see if the issue is still present. If that resolves the issue, you’ll want to get in touch with your theme’s developer and see if they have an update or fix for you.

    If changing the theme doesn’t help, you’ll want to deactivate all plugins except for WooCommerce and take a look. If that fixes the problem, re-enable the other plugins one by one (gradually), checking after each, to see where the issue is coming from.

    — Be sure you have a good backup in place of your full site and database. You can ask your host for backup functionality or you can consider using a service like Jetpack. If something goes wrong, you will be able to restore it.

    — It is important to consider as well a staging functionality in case you would not like to touch your production site (you can ask your host if they offer this service), or you can use WP Staging for quickly spinning up a new test site.

    You can find more about this in this guide.

    Please let us know about your findings.

    Have a wonderful day!

      Thread Starter xtensions

      (@williamews)

      Thanks for the reply…

      1. Yes, we have already tried other browsers, but nothing changed.
      2. The site is an exsiting site and in production.
      3. No. Everything works fine in the Admin, excpet products and order editing (However, I should note that WP post and pages are having the same issue: Not able to add or edit WP post and page). But we narrow the issue to Woocommerce because the issue may have started after several attempts to edit or add product unsuccessfully.
      4. Already troubleshoot plugins and themes. Chaging themes did not change anything.
      5. When we try to add or edit Woocommerce products, it redirects to the 404 error page (Once in a while, it works and does not redirects, but mostly it redirects to the 404 error page).
      6. Website/Store php memory is set to 1024MB, but that that also did change anything.

      We have never seen this issue with Woocommerce before…

      Hi @williamews,

      Thanks again for getting back to us with further details on this.

      It seems like you’ve already tried a lot of troubleshooting steps. However, the issue you’re describing could be related to a conflict with another plugin, theme, or even a server configuration issue.

      As a next step, I recommend disabling WooCommerce from your staging site to see if you’re able to make posts from your WordPress dashboard. If this works correctly, then that would point the issue to your WooCommerce installation.

      Another thing to check is the permalink settings on WordPress. Sometimes, simply saving the settings again can fix issues with 404 errors. You can do this by going to Settings > Permalinks in your WordPress dashboard and clicking the ‘Save Changes’ button.

      If neither of these steps resolve the issue, it might be worth reaching out to your hosting provider. They may be able to provide further insights into what’s causing the 404 errors.

      I hope this helps.

      Thread Starter xtensions

      (@williamews)

      As you may have noticed, we have already spent a very long time on this problem… I disabled all plugins except Woocommerce, but that didn’t change anything.

      Question: Are there any ModScurity Rules that can be causing this issue in Woocommerce? Many people who have experienced similar problem with Woocommerce noted that it was some ModSecurity Rules causing the issue.

      Thread Starter xtensions

      (@williamews)

      Can it also be an issue related to the new “Woocommerce Order Attribution” feature?

      Hi again,

      we have already spent a very long time on this problem… I disabled all plugins except Woocommerce, but that didn’t change anything.

      Were you able to flush the permalink settings as I had recommended in the reply above? A similar issue was resolved by saving the permalinks settings as described in this thread.

      Many people who have experienced similar problem with Woocommerce noted that it was some ModSecurity Rules causing the issue.

      I can confirm we’ve not had any recent issues with ModSecurity, however, if you suspect that ModSecurity is causing issues, you may want to check your server’s error logs for any ModSecurity entries. If you find any, you can work with your hosting provider to adjust the ModSecurity rules or disable them for your site.

      Can it also be an issue related to the new “Woocommerce Order Attribution” feature?

      I’m afraid WooCommerce Order Attribution feature could not be leading to the issue with 404 errors in your store. However, let’s take a few steps back to understand more about the issue. Could you please clarify when exactly the issue started, or is this a brand-new store still in production stage?

      Thread Starter xtensions

      (@williamews)

      Hi there! We open this thread because we have already exhausted all the above suggestions…

      We tried resetting permatlinks several times.

      We already checked server logs, and disabled the ModSec. rules that we thought are causing the problem…

      I mentioned the “Order Attribution” feature because out of the dozes of findings and troubleshooting, I stumbled on this from Woocommerce’s site: https://developer.woocommerce.com/2024/01/16/woocommerce-8-5-1-issues-with-web-application-firewalls-modsecurity/

      Thank you!

      Plugin Support Shameem R. a11n

      (@shameemreza)

      Hi @williamews

      Thank you for your patience and for sharing detailed information on the steps you have already taken. I understand how frustrating this issue can be.

      I mentioned the “Order Attribution” feature because out of the dozes of findings and troubleshooting, I stumbled on this from Woocommerce’s site: https://developer.woocommerce.com/2024/01/16/woocommerce-8-5-1-issues-with-web-application-firewalls-modsecurity/

      This issue arose in WooCommerce 8.5.1, but was resolved in version 8.5.2. If you are using a version of WooCommerce older than 8.5.2, updating WooCommerce to the latest version might resolve the issue.

      If you use WooCommerce 8.5.2 or later, the issue might be related to your .htaccess file. Sometimes, this file can become corrupted, causing 404 errors. To check if this is the issue, you could try resetting your .htaccess file.

      To do this, you need to access your WordPress installation via the hosting file manager or FTP, find the .htaccess file in the root directory, rename it to .htaccess_old, and then try to reaccess your site. If this resolves the issue, you can generate a new .htaccess file by going to Settings > Permalinks and clicking “Save Changes”.

      If this makes no difference, please let me know and we will continue to investigate the issue.

      Thank you for your cooperation and understanding.

      Thread Starter xtensions

      (@williamews)

      Hi there! As I mentioned, we have spent a lot of time troubleshooting this problem… We have already troubleshoot clearing .htaccess and leaving only the default WP .htaccess content in it, but that did not resolve the issue. I think if the problem was related to that, leaving only the script below would had solved the problem.

      BEGIN WordPress

      RewriteEngine On
      RewriteRule .* – [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
      RewriteBase /
      RewriteRule ^index.php$ – [L]
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule . /index.php [L] END WordPress

      Thank you

      Plugin Support RK a11n

      (@riaanknoetze)

      Certainly sounds like you’ve gone to great lengths to get to the bottom of this – Can only imagine how frustrating this must be.

      A few more thoughts that come to mind while reading through the thread so far:

      • Do you have any server-side logging enabled to indicate the sequence of events/redirects that’s leading to that 404 page (I’m also wondering whether maxing out server resources might be leading to that 404 page)?
      • Please share copy of your status report found under WooCommerce > Status
      • Might be a silly question, but is debug logging enabled in your wp-config file?
      • With this earlier comment “I should note that WP post and pages are having the same issue: Not able to add or edit WP post and page” –> It sounds like the behaviour extends beyond WooCommerce and is most at WordPress-level (seeing as WooCommerce uses WordPress’ post-type functionality. Have you already reached out to your hosting provider to see if they can shed more light on what’s happening?
      • For WooCommerce, are you using the new product editor (beta)? What happens when you switch from Gutenberg to the classic editor?
      Thread Starter xtensions

      (@williamews)

      Do you have any server-side logging enabled to indicate the sequence of events/redirects that’s leading to that 404 page (I’m also wondering whether maxing out server resources might be leading to that 404 page)?

      Yes, I did check server-side logs, and files and folder permissions and ownership look good…

      Please share copy of your status report found under WooCommerce > Status

      I will add the status report when I access the site later.

      Might be a silly question, but is debug logging enabled in your wp-config file?

      I did enable debug in wp-config file and the errors were related to 2 outdated plugins that I already removed, but that didn’t change anything… Those plugins were really not in use so I just delete them…

      With this earlier comment “I should note that WP post and pages are having the same issue: Not able to add or edit WP post and page” –> It sounds like the behaviour extends beyond WooCommerce and is most at WordPress-level (seeing as WooCommerce uses WordPress’ post-type functionality. Have you already reached out to your hosting provider to see if they can shed more light on what’s happening?

      The server’s error logs are not showing anything that requires attention regarding this particular issue… So I turned to ModSecurity since many other people who ran into similar issue mentioned ModSecurity as the cause. The only suspicous logs that got my attention were ModSecurity logs where I found the 404 Errors… So I focused on ModSecurity finally… While troubleshooting, I completely disabled ModSecurity and the issue was resolved. Then I turned ModSecurity on and the issue returns… So I finally do believe the problem might be ModSecurity related… I tried to disable some of the ModSecurity Rules that I found in the logs that could be blocking some actions in Woocommerce, but it did not resolve the problem…

      Some people suggested to completely keep ModSecurity disabled, but I think it is too much of a risk to take… The best thing is to continue troubleshooting and fixed the problem.

      For WooCommerce, are you using the new product editor (beta)? What happens when you switch from Gutenberg to the classic editor?

      No. I’m using the Classic Editor… But I should also note that I tried turning on the New Editor ON and OFF to see if it can resolve the issue and it was not loading properly, but then when it finally loaded, the isssue was not resolved with with the New Editor…

      Plugin Support Zubair Zahid (woo-hc)

      (@doublezed2)

      Hello xtensions,

      Thank you for your reply.

      I appreciate all the effort you’ve put into troubleshooting the issue.

      It’s great to hear that disabling ModSecurity seems to resolve the problem.
      This gives us a good clue!

      How about reaching out to your web host support team?
      They can help us figure out why ModSecurity is causing the site to break.

      Let me know how it goes. ??

      Best regards.

      Plugin Support Shameem R. a11n

      (@shameemreza)

      Hi @williamews

      We’ve not heard back from you in a while, so I’m marking this thread as resolved. Hopefully, you were able to find a solution to your problem!

      If you have further questions, please feel free to open a new topic.

      Thanks!

    Viewing 13 replies - 1 through 13 (of 13 total)
    • The topic ‘Cannot Edit or Add Product – 404 Error’ is closed to new replies.