Jump to content

Recommended Posts

Posted

Hello,

Is there a way to regenerate the name from the title in the API, like:

$myPage->regenerateName();
$myPage->save();

or similar? I'm looking to batch rename a lot of urls, but only once.

Posted
foreach ($pages->find('template=basic-page, limit=50') as $p) {
	$p->of(false);
	$p->title = "My New Title";// if using a new title...otherwise comment out this line 
	$p->name = $sanitizer->pagenName($p->title);
	$p->save();
	$p->of(true);
}

If renaming in the thousands let us know so that we can adjust the code...

  • Like 5

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...