0

Products still present and searchable on frontend even if disabled on the Backend with Magento 2.4.2.

Hello,

I encountered issues on the product still searchable on frontend even if disabled.

Version: Magento 2.4.2 php7.4

I also performed the following but it doesn't work

  1. bin/magento cache:flush

  2. bin/magento cache:clean

  3. bin/magento indexer:reindex

Thanks for your help in advance.

1 Answer 1

0

there are a few more specific steps and considerations you can take to resolve the issue:

Steps to Troubleshoot and Fix the Issue:

  1. Check Product Status and Visibility:

    • Ensure that the product is indeed marked as "Disabled" in the backend.
    • Check the "Visibility" attribute of the product to make sure it is set correctly.
  2. Rebuild Search Indexes:

    • You have already reindexed, but ensure that the reindexing process completes without errors:
      bin/magento indexer:reindex
      
    • Check the status of your indexes to ensure they are all valid:
      bin/magento indexer:status
      
  3. Clear Varnish Cache (if applicable):

    • If you are using Varnish, ensure that the Varnish cache is also cleared:
      bin/magento cache:flush
      
  4. ElasticSearch Configuration:

    • Magento 2.4.2 uses ElasticSearch as the default search engine. Ensure that your ElasticSearch instance is running correctly and that it is properly configured.
    • You may need to restart ElasticSearch to ensure it picks up the changes:
      sudo systemctl restart elasticsearch
      
  5. Check Indexer Configuration:

    • Ensure that the indexers are set to "Update on Save" instead of "Update on Schedule":
      bin/magento indexer:set-mode realtime
      
    • Verify the mode with:
      bin/magento indexer:show-mode
      
  6. Update ElasticSearch Mapping:

    • Sometimes, ElasticSearch mappings need to be updated. This can be done by running:
      bin/magento indexer:reindex catalogsearch_fulltext
      
  7. Custom Code or Modules:

    • Check for any custom modules or third-party extensions that might be interfering with the default behavior of product status updates.
    • Disable any custom modules one by one to see if the issue persists.
  8. Database Integrity:

    • Check the database directly to ensure the product status is set correctly. Run a query to confirm:
      SELECT * FROM catalog_product_entity WHERE entity_id = [product_id];
      
  9. Logs and Error Checking:

    • Check Magento logs for any errors or warnings that might provide clues:
      var/log/exception.log
      var/log/system.log
      
  10. Frontend Cache and Browser Cache:

    • Ensure that the browser cache is cleared and that any frontend caches (like Full Page Cache) are also cleared:
      bin/magento cache:flush
      

Example Commands:

# Clear Magento cache
bin/magento cache:flush

# Clean Magento cache
bin/magento cache:clean

# Reindex data
bin/magento indexer:reindex

# Ensure indexer mode is set to 'realtime'
bin/magento indexer:set-mode realtime

# Check the status of indexers
bin/magento indexer:status

# Reindex the catalog search index
bin/magento indexer:reindex catalogsearch_fulltext

# Restart ElasticSearch (if necessary)
sudo systemctl restart elasticsearch

Additional Debugging Steps:

  1. Debugging Custom Code:

    • Temporarily disable custom modules or themes to see if the issue is related to customizations.
    • Review custom code that might interact with product visibility or search functionality.
  2. Check Storefront Settings:

    • Ensure the correct store view is selected and that the product is disabled in all relevant store views.

you should be able to identify the root cause of the issue and ensure that disabled products do not appear in search results on the frontend of your Magento 2.4.2 store.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.