Change URL (slug)
ps_change_url
Changes a page address and makes sure the old address redirects to the new one.
Ask Claude
„Change the URL of product 45 from solar-lamp-x to solar-garden-lamp-x and make sure the old one redirects.”
Example preview
Product 45, language en. Old: /garden-lighting/45-solar-lamp-x.html New: /garden-lighting/45-solar-garden-lamp-x.html Canonical redirect: 301. Old URL will redirect 301 to the new one. After saving: check of the old URL.
Technical details
Changes the friendly URL (slug, link_rewrite) of a product, category, CMS page, blog post or blog category in one language. The preview shows the old and new URL, URLs changed as a side effect (for example products of a category whose name is in the product URL) and whether the old URL will redirect with 301. The change is BLOCKED when the store redirects with 302 instead of 301, developer mode is on, or a module overrides routes. After execution the tool requests the old URL itself, expects a 301 to the new one and reports the result.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| object_type | enum: product | category | cms | blog_post | blog_category | yes | Object type. |
| object_id | integer | no | Object ID (for a product you can use product instead). |
| product | string | no | Product as a person refers to it: id:123, ref:ABC-1, ean:5901234123457, a product URL from the store, a bare ID (1-7 digits), an EAN (8/12/13 digits) or a reference. Instead of object_id for object_type=product. |
| new_slug | string | yes | New slug: lowercase letters without diacritics, digits and hyphens (e.g. black-kids-sandals). Max 128; SmartBlog post max 45. |
| lang | string | when: shop has more than one active language | ISO code of the language you write in. Required when the shop has more than one active language. Claude writes the content in this language. |
| shop_id | integer | no | Shop ID in a multistore installation. Defaults to the shop in the connector address. IDs are listed by ps_get_shop_info. |
| confirm | boolean | no | false (default) returns a preview and saves nothing. true executes, only after the user approved the preview, together with change_token. |
| change_token | string | when: confirm=true | Token from the preview. Required with confirm=true. Valid 30 minutes, single use, bound to the previewed arguments and data state. |
Limits
One object and one language per call. Blocked on 302 canonical redirect, developer mode or route-overriding modules. Not undone by ps_revert_change: undo with another ps_change_url.
What you see before anything is saved
Claude first calls the tool without confirming it. The module returns a preview (current and new values) and a single-use token valid for 30 minutes. Claude shows you the preview and saves the change only after your yes.
Related tools
- Inspect a store page ps_inspect_page
- 404 report ps_get_404_report
- Get shop info ps_get_shop_info
- Check shop health ps_check_shop_health
Last updated: 2026-10-03