(CNN) — In a few years, you'll no longer be able to rely on hotels in California for those travel-size bottles of shampoo and lotion.

California Gov. Gavin Newsom signed a bill Wednesday that bans hotels from supplying such bottles in an effort to reduce the number of plastic containers being thrown away by hotels and guests.

The bill, set to take effect in 2023, will apply to lodging establishments with more than 50 rooms. Hotels with less than 50 rooms must stop using the tiny bottles by 2024.

This would not impact hospitals, nursing homes, residential retirement communities, prisons, jails or homeless shelters, according to the bill.

If a hotel in California doesn't comply with the ban, its owners and operators could be subject to monetary fines. On the first violation, a written warning will be given along with a $500 fine for each day the lodging establishment is in violation, according to the bill. Any second or subsequent violations would result in a $2,000 fine.

Assembly Member Ash Kalra of San Jose co-authored the bill, known as AB 1162. Kalra has said small plastic bottles under 12 ounces cause a sizable amount of waste and believes his law will help reduce the problem.

California has been at the forefront of bans on single-use plastics and became the first state to ban plastic bags in 2014. New York state also moved to do the same with plastic bags last month and is now looking to prohibit hotel plastics with a bill sponsored by New York Sen. Todd Kaminsky.

Related content The biggest source of microplastics in California coastal waters? Car tires

"Little everyday actions, like eliminating small plastic bottles, will have a positive impact on our environment," Kaminsky said in a press release. "By barring hotels from giving single-use plastic toiletries to customers, we are safeguarding our environment, and mitigating plastic waste and waterway pollution."

Related content A floating device created to clean up plastic from the ocean is finally doing its job, organizers say