Im making a custom plugin for wordpress and i need to create a page in the admin menu. I already have a file called mailing_list.php with the following code:

function jps_mail_list_page_entry() {
        __('JPS Mailing List'),
        'JPS Mailing List',
add_action('admin_menu', 'jps_mail_list_page_entry');

function jpsNews_mailing_list() {
    echo 'hello';

Now, in the plugin page i have this:

function jpsNews_activate_plugin() {

Its not working so, is it even possible to do it like this? how can i do it?

thanks in advance.

  • Try adding a sub page.
    – Cedon
    Commented May 25, 2017 at 18:55

1 Answer 1


found the problem. Turns out the function that creates the pages needs to be outside the activation hook. moved it to the end of the script and works perfectly.

Thanks =)

Your Answer

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

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