Title: register_activation_hook
Last modified: August 20, 2016

---

# register_activation_hook

 *  [Josh](https://wordpress.org/support/users/josh401/)
 * (@josh401)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/register_activation_hook-2/)
 * Hi,
 * I’m trying to add a custom message to my plugin upon activation. I would simply
   like to show a message telling the user to please visit the plugin settings page.
 * I have tried this hook;
 *     ```
       function jwl_visit_settings_page () {
        echo '<div id="message" class="updated"><p>Thank you for choosing Google Webfonts.  Please visit the settings page to get started.</p></div>';
       }
       register_activation_hook(__FILE__,'jwl_visit_settings_page');
       ```
   
 * but I receive an error about generating xxx characters of unexpected output… 
   and no message.
 * I believe this has something to do with running the hook within the main.php 
   file.
 * All of my functions, from creating the admin pages and options, to displaying
   all content, is all located in one file.. my `main.php` file.
 * What exactly is it I’m missing here?

The topic ‘register_activation_hook’ is closed to new replies.

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 0 replies
 * 1 participant
 * Last reply from: [Josh](https://wordpress.org/support/users/josh401/)
 * Last activity: [14 years, 5 months ago](https://wordpress.org/support/topic/register_activation_hook-2/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
