• Resolved Nate

    (@kapitol)


    This is so bizarre but when I change the name of a page which is the top page to a hierarchy of other pages the name and permalink doesn’t change.

    That creates a problem when I make links to point at the pages.
    An Example would be:

    The old URL with the page name “billing” looked like:
    https://localhost/blank-wp/billing/

    The new URL with the page name “services” looks like:
    https://localhost/blank-wp/billing/

    So when I make a link to services the 2nd link always shows up. It’s like after I made the change the database made the switch but for some odd reason it never told WP to switch visual name.

    I’m dumbfounded. I really don’t know how to fix this situation. Does anyone know of a solution?

Viewing 5 replies - 1 through 5 (of 5 total)
  • When you first create a page or post WordPress creates a default permalink (URL) based on the contents of the page or post title. Once it has saved that original permalink it never again automatically changes the permalink, even if you change the page title. The reason is the post could be 2 years old and linked on Google and other sites. If it auto-changed the permalink when the title changed you could lose your links and existing page ranking.

    After the initial permalink has been saved you are free to change the permalink yourself if you change the title (or for any other reason). There are two ways to do this. Both involve clearing out the contents of the permalink field which is just below the page/post title box.

    If you clear it out and save it when it is empty WordPress will create a new permalink based on the contents of the title field. Or, you can type it in yourself, into the cleared out field.

    It was a little hard to understand what you were asking about. I think what I replied to addresses your question.

    Thread Starter Nate

    (@kapitol)

    Yeah that’s exactly what I was referring to. I honestly didn’t know how to phrase the question because the terms I used are used for other problems and google came up empty handed which is rare.

    The direct issue I’m having with this is when I link other pages to services. I’m using a page’s loop as the basis of a entering its HTML. When I do that I can’t use template tags to refer to other pages easily.

    In a file I could do <php bloginfo(‘template_url’); ?>/services/ but instead I’m forced to use ../billing/ Which then shows up in the address bar of a browser as https://localhost/blank-wp/billing/ instead of the desired https://localhost/blank-wp/services/

    I’m sorry, you lost me with your last response. I don’t understand what you are doing.

    I’m using a page’s loop as the basis of a entering its HTML.

    do you have a code example of what you are doing?

    i don’t understand about billing vs services either

    Thread Starter Nate

    (@kapitol)

    A review

    Goto the admin section > Pages > Services. Once it’s open you paste the HTML code inside the Edit Page box. (Below the title) I can’t believe this is so uncommon.

    Billing is just a Page. As is Services. I created billing then later changed the name of the Page to Services. My whole point to asking this question was to see if I was experiencing a bug since my Billing page name didn’t change when I switched the name to Services.

    You answered that question by stating it doesn’t change if you rename a page unless you change it’s slug name in the edit page area. But the core name stays the same regardless.

    I responded by saying I agreed with what you said. Then I stated that because the name of the page never changes in the database I will have issues trying to link pages to it.

    To clarify I was wrong about which links weren’t working. It turns out after some testing that when I use sample 1 listed below links work fine. It’s in sample 2 where I have the issues of WP handling the data incorrectly.

    Sample 1
    So for example. I changed the name of the Page to Services, it was Billing. When I paste code into the Edit Page area I cant use PHP because of the way WordPress handles it. So I have to use a link that looks like, <a href="../services/ambulance-ems/" title="Learn more about our EMS Services"></a> – This link goes to the correct location.

    Sample 2
    So a normal link in a template file would be handled like this.
    <a href="<?php echo get_option('home'); ?>/services/ambulance-ems/" title="Learn more about our EMS Services"></a> – This link doesn’t work.

    To make the sample 2 link work I could change services to billing. But that isn’t the point. The point I want to make is I wanted to change the name of the page from billing to services and have all links from every location within wordpress work by using /services/.

    I hope that clarifies what we had just discussed.

    Hi

    I wrote what is farther below ( in this reply) before I saw what is most likely your problem. I left the other part in, in case it is relevant.

    You can’t use relative links in WordPress. A relative link is one like this
    <a href="../services/ambulance-ems/" title="Learn more about our EMS Services"></a>

    which means go up one level, because the level the URL is being seen as varies depending on the page on which the content is being displayed.

    I realize you say that is the one that is working but in some ways that is a fluke. The reason you can’t use relative links in WordPress or most CMS systems is the link is relative to the URL the content is being called from. In WordPress content can be called from a number of positions – posts on a single page, a category page, a tag page, the blog page. The URL in each case is different – different numbers virtual folders, and relative links generally only work correctly in some of those cases, and give a 404 in others.

    You really need to use a hard coded link. You don’t need to include https://mydomain.com but you do need to include everything that comes after that STARTING WITH A SLASH. That is what creates the hard code – it has to be the path from the web root to the actual URL. That is the only way to get consistent results.

    AS far as a template tag I use links like this and they always work
    <a href="<?php bloginfo('url'); ?>/services/ambulance-ems/" title="something">something else</a>
    ==============
    below, if this helps

    You answered that question by stating it doesn’t change if you rename a page unless you change it’s slug name in the edit page area. But the core name stays the same regardless.

    I never said “the core name stays the same regardless” because that is not how it works. When you change the permalink, also called the page slug, the old name goes away.

    If your billing page name didn’t change when you changed the name to services it is kind of likely you had two pages named billing (accidently creating one) and that is the one that is showing up. I have done that myself.

    When WordPress encounters what would be a duplicate permalink it tacks a number on the end billing-2 service-2 If you are not paying close attention you can miss this.

    This has gotten trickier since they changed the delete function to a trash function because you can have pages you thought you deleted sitting in the trash that continue taking up a permalink. Sometimes I have accidently linked to the trashed one thus the link won’t work.

    What you are describing can not happen by WordPress out of nowhere. That is not the way it works. It is more likely that you have a duplicate somewhere that you are not aware of.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Page names not updating when changed’ is closed to new replies.