AnsPress allows the developers to easily customize question permalink as per their requirements. It already have 5 inbuilt custom question permalinks which can be selected in AnsPress options.
In this FAQ, we will see how to add a Category slug in question permalink. But this permalink will not work if question does not have any category so use it at your own risk.
After adding this snippet to your theme’s functions.php, save permalink in WordPress settings.