# Unable to adjust the pages' permalink at runtime without success

**URL:** <https://talk.jekyllrb.com/t/unable-to-adjust-the-pages-permalink-at-runtime-without-success/7349>\
**Category:** Uncategorized\
**Created:** [May 22, 2022, 5:53pm UTC](https://talk.jekyllrb.com/t/unable-to-adjust-the-pages-permalink-at-runtime-without-success/7349 "2022-05-22T17:53:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![andreamoro](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/andreamoro/32/4669_2.png) [@andreamoro](https://talk.jekyllrb.com/u/andreamoro)\
**Post date:** [May 22, 2022, 5:53pm UTC](https://talk.jekyllrb.com/t/unable-to-adjust-the-pages-permalink-at-runtime-without-success/7349/1 "2022-05-22T17:53:03Z")

</div>

Hello there,

I’ve seen several scripts, more or less similar to each others, that override the class PermalinkRewriter \< Generator to rewrite the permalink of a given post/pages. An example [here](https://github.com/mathifold/mathifold_first_version/blob/c80c27533bc863ec3678dde2846c1ac06b7f1e87/_plugins/link.rb).

I’ve been trying to do the same on Jekyll 4.2.2 without success. Even a simple replacement like the one below fails to produce the expected output

```auto
if p.data['slug'].include?("/test/") 
    puts("rewriting the permalink")
    p.data['permalink'] = "/hola"
end

```

The `puts` is generated three times although I’ve only one page with that slug variable. At code level I can see the permalink being replaces, but in fact the page is not accessible via the new permalink but the old one.

Do you have any idea?  
Thanks
