For a project, I needed a way to easily restrict access to content on a WordPress website on a per user basis.
There’s loads of existing plugins that over complicate this significantly, so I thought I would test Gemini‘s capability at writing WordPress code.
The result is Content Restrictor – and it works very nicely for my needs:
- Pages and posts have a check box – should this be restricted or not?
- Each user page now has a section with a list of all the restricted pages, and if checked, that user can view the content, else they get a message
- The message can be customised in the settings
- There’s also a short code to display all the restricted pages that the current user has access to
- Admins accounts bypass the restrictions entirely
If it works for you tool, feel free to grab it from GitHub!