Support » Fixing WordPress » How to redirect a link with a named anchor

  • In a guest post, a friend of mine linked to an url like this: example.com/test.php#2. Since he’s using WordPress now, he’d like the link url to be this: example.com/test.

    Basically, we need a way to redirect the old url with a named anchor to a new url with no named anchor.

    A quick snippet of Javascript tucked away neatly in the header would do the job … but with WordPress, that’s not so easy. We can’t tuck it into a header.php file that would apply to every single page on the site.

    Ideas, anyone?

  • The topic ‘How to redirect a link with a named anchor’ is closed to new replies.