Title: permalink_structure_changed action hook
Last modified: May 27, 2019

---

# permalink_structure_changed action hook

 *  Resolved [andrewbirmingham](https://wordpress.org/support/users/andrewbirmingham/)
 * (@andrewbirmingham)
 * [7 years ago](https://wordpress.org/support/topic/permalink_structure_changed-action-hook/)
 * for the life of me i can not hook into this supposedly available action.
 * <?php
 * add_action( ‘permalink_structure_changed’, ‘my_custom_function’ );
 *  function my_custom_function()
    { echo ‘<script>alert();</script>’; }
 * ?>

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [Stef](https://wordpress.org/support/users/serafinnyc/)
 * (@serafinnyc)
 * [7 years ago](https://wordpress.org/support/topic/permalink_structure_changed-action-hook/#post-11574458)
 * Make sure your not leaving the `<?php` and the close in there. There’s already
   one in your functions file. But that’s not even how you change the structure.
    -  This reply was modified 7 years ago by [Stef](https://wordpress.org/support/users/serafinnyc/).
 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [7 years ago](https://wordpress.org/support/topic/permalink_structure_changed-action-hook/#post-11574758)
 * Verifying a hook fires by setting an alert box is unreliable in PHP because the
   browser is not always expecting output when actions fire. In such cases the output
   is ignored. Try using error_log() to send debug messages to the log file.
 *  Thread Starter [andrewbirmingham](https://wordpress.org/support/users/andrewbirmingham/)
 * (@andrewbirmingham)
 * [7 years ago](https://wordpress.org/support/topic/permalink_structure_changed-action-hook/#post-11576887)
 * [@stef](https://wordpress.org/support/users/stef/)
 * this was just simple plugin i created to test only the hook. it’s not within 
   my other php anywhere. sorry for confusion.
 * [@bcworkz](https://wordpress.org/support/users/bcworkz/)
    thanks for the input
   going to try this out now.
 * it worked. really appreciate the feedback. been a long few weeks late night. 
   my mind is starting to get discombobulated
 *  [Stef](https://wordpress.org/support/users/serafinnyc/)
 * (@serafinnyc)
 * [7 years ago](https://wordpress.org/support/topic/permalink_structure_changed-action-hook/#post-11577234)
 * No worries. All good.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘permalink_structure_changed action hook’ is closed to new replies.

## Tags

 * [permalink](https://wordpress.org/support/topic-tag/permalink/)

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 4 replies
 * 3 participants
 * Last reply from: [Stef](https://wordpress.org/support/users/serafinnyc/)
 * Last activity: [7 years ago](https://wordpress.org/support/topic/permalink_structure_changed-action-hook/#post-11577234)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
