Updating Permalink Structure from a Plugin

If you need to update/re-save the permalink structure from within your plugin, here’s how:

<?php
	global $wp_rewrite;
	$wp_rewrite->set_permalink_structure( get_option( 'permalink_structure' ) );
	$wp_rewrite->flush_rules();
?>

2 thoughts on “Updating Permalink Structure from a Plugin”

Leave a Reply

Your email address will not be published. Required fields are marked *