I need to make if statements for every permalink structure, so I need to know if there is a function that returns to me the actual selected permalink structure by the user. To make it simple all I need to know is if this permalink:


a condition will apply else if this structure


is used then another condition is applied.

So all I need to know is if there is function in Wordpress that can return me what structure the website is using.

1 Answer 1


The structure is stored in the option permalink_structure. Pretty permalinks are disabled if the option is empty.

$structure = get_option( 'permalink_structure' );

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.