Where does the $title variable come from in your code? You don't show where it is set. To set the URL you want to set the name of your page. $np->name = 'something'; If you don't set a name (as in your code) the name is generated automatically from the title. If you are setting a name from a variable you can pass it through $sanitizer->name($my_variable) to make sure it is a valid name. In your case you want to set the name to the same as the page ID. But when you are first creatin
    • Like