Two wards at Scarborough Hospital and one at Bridlington have been closed due to an outbreak of norovirus.
At the time of going to print, the wards affected were Chestnut and Graham at Scarborough and Johnson at Bridlington.
Bosses at York Teaching Hospital NHS Foundation Trust are asking people to think carefully before paying any non-essential visits to see friends or relatives.
A spokesperson said: “We are specifically asking people who have been unwell not to visit the hospital until they have been free of symptoms for 48 hours.
“This is really important because the virus is highly infectious. The virus is easily spread by contact with an infected person, especially through their hands.
“Closing wards helps us to contain the virus but visitors can play a large part by staying away if possible and we would urge visitors to think carefully before paying any non-essential visits at this time.”
People are asked to wash their hands before and after visiting and use the hand sanitizer gel.
The hospital is due to be inspected by the Care Quality Commission from March 18 to 20.
Sir Mike Richards, chief inspector of hospitals, said: “We will look at the quality and safety of the care provided, based on the things that matter to people.
“We will look at whether the service is safe, effective, caring, responsive to people’s needs and well-led.”
Before the inspection people are asked to leave feedback at www.cqc.org.uk/content/york-teaching-hospital-nhs-foundation-trust-please-share-your-experience
Patients can also use the commission’s website to look at previous reports, give feedback and sign up for email alerts about future reports.