Anchor Links Not Working in Full URL in Menu

I’ve added full URLs with anchor links to my main menu. I’ve named the IDs to be unique and not any duplicates on the site. The anchor links are not working.

When I manually enter the full URL with the #anchor-link, that works and goes to the div with the corresponding ID. I’ve read a bunch of other posts here, tried deactivating plug-ins, clearing caches, re-saving the menus, etc.

Nothing seems to work. Anyone else run into this? Help needed. Thx!

To clarify. The anchor links in the menu work when I am on the same page as the sections I am anchoring to. But when I try to link from another page, they do not work. The links just go to the top of the page. They don’t scroll down to the section ID specified after the #.

Hi Jay,

A link to the site will be helpful.

In the post you deleted you mentioned it works when you add the www subdomain to your url, this is because you have decided to setup your site to use the www subdomain but it is accepting connections on the non-www domain. You need to decide which domain you are going to use and redirect to the other, then everything will work as designed.

Thanks. I switched the word press setting to remove the “www” and updated all links. Unfortunately, I am still having the issues. Anchor links works on same page, but not using full URL link from another page. Any help greatly appreciated! @craiger522

A link to the site will be helpful.

Link: RISE Community – RISE COMMUNITY

If you navigate to about page, then click menu item “pricing” or “FAQs” you should see the behavior.

If you follow whats going on in the network tab it seems to hit a 404 then get redirected to https://rise-community.com/community/
Do you have any redirections in place?

You can see this in the browser address bar too the #rise-pricing gets dropped from the address bar

I didn’t set up any redirects.

I noticed that as well. Was wondering if a plugin could cause that, but I’ve disabled almost all.

Hard to know, what I do know is that if you use commandline Curl it does not do the redirect

➜  ~ curl -s -L -D - https://rise-community.com/community/#rise-pricing -o /dev/null
HTTP/2 200
link: <https://rise-community.com/wp-json/>; rel="https://api.w.org/", <https://rise-community.com/wp-json/wp/v2/pages/2>; rel="alternate"; title="JSON"; type="application/json", <https://rise-community.com/?p=2>; rel=shortlink
cache-control: max-age=600
expires: Fri, 13 Dec 2024 17:48:58 GMT
vary: Accept-Encoding,User-Agent
content-type: text/html; charset=UTF-8
date: Fri, 13 Dec 2024 17:38:58 GMT
server: Apache

Which leads me to believe it is either a plugin doing it, or some javascript.

I saw some other posts about a Javascript conflict that could do it and some code you could paste in. It was an old post. Tried it but didn’t work. Tracking down javascript is way beyond my skillset. :slight_smile:

You may need to open a ticket a ticket to take this further. Might even be something at a server level.

BB itself does not have anything built in that does redirects.

:+1: thx for your help. Appreciated! :raised_hands: