Here are two macros to hide and show widgets on the desktop in macOS Sonoma.
Widgets in Sonoma.kmlibrary (5.4 KB)
For more information, see the wiki Searching the Forum for Answers section.