I saw This link and I want to do the same thing in magento 2. I want to associate all products to some list of websites.

1 Answer 1


I think I found the solution there is a method in Magento\Catalog\Model\Product named updateWebsites($productIds, $websiteIds, 'add');

Your Answer

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

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