How to hide specific categories in the “add post” section for specific user roles?

Working solution for WordPress 6.6.1 Aug 2024:
I am going to answer my own question since I found an answer now, in case it is useful for others.

As of Aug 2024, there are no plugins that can do this and the plugins mentioned in several guides on the internet have been removed. I have found a code solution that works on 2024 fo WordPress 6.6.1:

The code posted in the accepted answer here by Khadka Pushpendra still works for Aug 2024. It is very similar to the 4th link in my original question, but I tested it and unlike the code in link 4, this one does not hide the category in the front end, only in the back end on the Add Post page which is exactly what I want. It hides certain categories from all user roles other than Administrators (see below).

Where it says “current_user_can( ‘manage_options‘”, if you need to, change the “manage_options” to a capability that only administrators have. Then everyone who does not have this capability will not see the categories. eg for me, I have other users with the “manage_options” capability so I couldn’t use this, I had to change it to “create_users” because only admins can do that.

It might give them the ability to edit categories (ie change the spelling or even delete categories) but if you remove this abilty, they will not be able to add new ones either, so I used an admin dashboard menu editor such as Advanced Access Manager to remove access to the Post -> “Categories” option, so the non-admin users can only add new categories but not edit existing ones.

Hope this is helpful to someone.

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