The project was first trialled in five health boards last year to make visiting hours fit better with modern working life and make the NHS more “user-friendly”.
It has now been extended to 500 wards across Scotland with some health boards allowing patients to name visitors they wish to have 24-hour access.
It has helped patients feel less lonely and separated from relatives and friends, the NHS said.
All boards in Scotland are encouraged to extend convenient visiting times through the national Person-Centred Health and Care Collaborative improvement programme led by Healthcare Improvement Scotland.
Health Secretary Alex Neil said the changes in visiting have helped patients, families and staff and have also eased parking congestion at some hospitals.
Mr Neil said: “While patient care will always be the top priority for our NHS we must ensure that we do everything we can to make any hospital stay better.
“Being away from loved ones can be difficult - especially when separation is as a result of ill health. That is why it is so important that our NHS does more to allow family, friends and carers be more involved with the care their loved one receives in hospital.
“The improvements that health boards have made represent substantial progress and it is good news for patients, their families, friends and carers when visiting is made more flexible. It shows that positive changes are possible when we focus on what matters most to people and support our staff to develop and test new ways to ensure this happens.
“I am very encouraged to hear that staff, the true heart of our NHS, support this better approach to improving the care experience for people while in hospital.
“But I want to see boards across Scotland maintain the pace and momentum of this change so that even more wards are operating the kind of flexible approach to visiting that is so obviously benefiting patients where it has been introduced.”