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.


1 Answer 1


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 }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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