WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am developing WordPress plugin.This plugin has own login system.Which means users can register into the system. Then they can login. if the user login, i want to redirect them to their own profile page.This page should not be accessible while user is in logout or plugin is in inactive.So how can i create page through plugin.


share|improve this question
up vote 3 down vote accepted

If the page needs to be added and available on the front end, you can use wp_insert_post() to create the page, the use a conditional to only display it if the user is logged in:

if(is_user_logged_in()) { // display content }

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.