• Hey guys,

    Does anyone know of a way that enables you to (for example) restrict an account to make a maximum of 5 extra pages on the website?

    So basically put a limit on the amount of pages a user can create (or total amount of pages)

    Or something in that general direction!

    Help would be much appreciated.

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    Well, it’s possible to query the database for a count of pages by a particular author, so what you want to do is possible. You’ll need to find the proper action or filter to hook onto, maybe one that fires when the user opens the new page editor.

    Then your hook function can do the count query, and if the result is more than or equal to 5, it could simply do a wp_die() with an error message.

Viewing 1 replies (of 1 total)
  • The topic ‘Way to restrict amount of pages that can be created?’ is closed to new replies.