cmd-w to close pinned tabs

Is there a keyboard shortcut to close pinned tabs in Safari?

I tried cmdW like for normal tabs but it didn't work.


As a workaround, I'd set up a keyboard shortcut in Safari for both Pin Tab and Unpin Tab to the same shortcut, e.g., ⌥⌘P and then you can toggle the pinned status of the Tab with the same keyboard shortcut.

This way when a Tab is pinned and you want to close it, using the keyboard, you'd first press, e.g., ⌥⌘P then: ⌘W

System Preferences > Keyboard > Shortcuts > App Shortcuts

enter image description here