Magento 2, You can retrieve Website id from the website code. Sometimes you need website id from the code, You have website code already exists but need website id, You can get it simply with Magento.
Use Interface:
Magento\Store\Api\WebsiteRepositoryInterface Continue reading “Get Website id from website code Magento 2.”