How to bulk product websites update using Magento 2?

Magento contains the queue message functionality to bulk product websites update.

If your store is running with multiple websites and wants to update a bulk website for the products in your store you will not see immediate changes on the products after the update is completed. That dependes on the cron running status.

It will display notifications after successfully updating the website, Message is added to the queue.

Queue Name:
product_action_attribute.website.update

Database Table:
queue_message & queue_message_status

It will take some time to update all the products in the store based on the cron settings.

If you want to do it manually via the command line, you need to run the command,

php bin/magento queue:consumer:start product_action_attribute.website.update

You will see the records under the queue_message table with a topic.name column value product_action_attribute.website.update and body column contains the product info.

You can check the status of each item from the database table, queue_message_status.

Each record in this table links to queue_message with the message_id column and the status column has the status value of each item.

The status column contains a value equal to 2, it indicates the message is generated with the status new.

Status value equals 4 means queue consumers completed and our products assigned with a new website.