How to set WordPress permalink settings from functions.php

This snippet allows you to set the WordPress permalink settings from the functions.php file, rather than from the WordPress admin.

Instructions:
Add this code to your functions.php file.
*note – the .htaccess mod_rewrite it is still necessary.

Related links:
http://codex.wordpress.org/Using_Permalinks#Structure_Tags

Comments

Leave a Reply

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

Snippet Info

Tested with Wordpress v. 4.7.3
Last Modified: 15.05.2018
Last Reviewed: 17.05.2017

How to set WordPress permalink settings from functions.php
4.7 (94.55%) 11 vote[s]
Please report broken snippets.
Report Broken Snippet
WP Engine