Way to change over 5000 pages Page Type without clicking them one by one?
Permalink
Hi there,
does anyone have suggestion of how I could change Page Type of very many pages without clicking them one by one?
If this can't be do I hope someone at least has solution of how I could filter page list results with Page Template instead?
Right now I have:
$list->filterByCollectionTypeHandle('optional_equipment');
but all the pages have a Page Type of "Page" so I would have to change them all to "Optional equipment"
Cheers, Petro
does anyone have suggestion of how I could change Page Type of very many pages without clicking them one by one?
If this can't be do I hope someone at least has solution of how I could filter page list results with Page Template instead?
Right now I have:
$list->filterByCollectionTypeHandle('optional_equipment');
but all the pages have a Page Type of "Page" so I would have to change them all to "Optional equipment"
Cheers, Petro
If you know the before and after page type ID, you could write a SQL statement to hack this directly in the database from the MySQL command line or phpMyAdmin.
Not the most correct way of doing it, but quick for a one-off change.
Not the most correct way of doing it, but quick for a one-off change.
That is allot faster indeed the Query would look something like this.
21 - the new Page Type ID
5 - the old Page Type ID
UPDATE Pages SET ptID = 21 WHERE ptID = 5;
21 - the new Page Type ID
5 - the old Page Type ID
It might be a good idea to paginate the result so you don’t run into memory issues.