How to clear capabilities cache?

That added the Settings menu at the left for a logged in Author.

Because the author role now has the required capabilities.

Then I removed the second line above and the Settings menu remains!

That’s because role data is stored in dedicated tables the same way as user meta and posts. It’s not like post type registration, it’s more like post/user creation.

I can reproduce this e.g. of ‘list-users’. It seems WordPress is caching the capabilities. How do I clear this cache and end this frustrating behaviour?

There is no cache, you would need to modify the role again with something like this:

$author_role = get_role('author');
$author_role->remove_cap('manage_options');

Or a CLI command such as this:

wp role reset author

deneme bonusu veren sitelerbahis casinomakrobetceltabetpinbahispolobetpolobet girişpinbahis girişmakrobet girişpulibet girişmobilbahis girişkolaybet giriş