Welcome to WebmasterWorld Guest from 18.208.211.150

Forum Moderators: rogerd & travelin cat

Message Too Old, No Replies

Changing the url structure in Wordpress

my current urls have the date in them but I want to change them to standard

     
8:13 am on Aug 28, 2015 (gmt 0)

Full Member

5+ Year Member

joined:June 5, 2009
posts:252
votes: 1


I want the urls to be standard, reflecting the article title. The site is a few years old and I was wondering if I change the urls now will Google devalue the links pointing to them? In other words, a google will seem them as new pages and therefore the value of age, links, etc will diminish? Typically, Wordpress has I think three url structure options and I think I went for the wrong one.

Secondly, I have noticed when I search for various terms I find there is date of publish on the search results next to my articles (this is different from the date in the url) but not always with other sites. How do I hide the dates on the search results? The site deals with mostly evergreen content and most of it on the site is as relevant today as it was few years back. I also update the articles to reflect to any changes anyway. But I fear when people see 2011 or 2012 next to the search results they may be less tempted to click on them fearing they could be a little out of date.
12:30 pm on Aug 28, 2015 (gmt 0)

Administrator from US 

WebmasterWorld Administrator not2easy is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Dec 27, 2006
posts:4201
votes: 265


The URL structure in Wordpress is set within the WP Admin Settings screen. You can change WP generated URLs to the format you like and WP will generate Rewrite Rules to add at the end of your htaccess file. The rewrites will take care of existing links. You can read more about this at the Wordpress Codex: [codex.wordpress.org...]
When you create or update a "pretty" permalink structure, WordPress will generate rewrite rules and attempt to insert them into the proper .htaccess file. If it can't, it will say something like "You should update your .htaccess now" and print out the rules for you to copy and paste into the file (put them at the end).
1:49 pm on Aug 28, 2015 (gmt 0)

Full Member

5+ Year Member

joined:June 5, 2009
posts:252
votes: 1


^Thanks. I can see six options in my Wordpress admin under permalink. My current setting is month and post name. However, I would like to change to just the post name. Will this change potentially hurt search rankings because most of the links pointing to my site from other sites has the url with the date and name rather than just the name?

Also, when I look at search results for my site I see date of publication next to the result. If the permalink is changed to post name only, will the date next to the search result disappear or will it require editing a php file in the admin? I don't want the date to be shown next to my search results.
2:14 pm on Aug 28, 2015 (gmt 0)

Administrator from US 

WebmasterWorld Administrator not2easy is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Dec 27, 2006
posts:4201
votes: 265


As quoted above, when you create or update a "pretty" permalink structure, WordPress will generate rewrite rules and attempt to insert them into the proper .htaccess file. If it can't, it will say something like "You should update your .htaccess now" and print out the rules for you to copy and paste into the file (put them at the end). This means that external links to your site will be translated at your site to the new URL via rewrites added to your htaccess file. You make the change, WP generates the rules, you add them to your htaccess file and the old links land on the new URLs.

To remove the date, add this to a css file:
.entry-meta {
display: none !important;
}

What file, where, depends on how your site is set up. If you use a child theme, add it to your custom css in the child theme. If you do not use a child theme, keep records because theme updates will overwrite your css change and you will need to add it in again.
4:26 pm on Aug 28, 2015 (gmt 0)

Full Member

5+ Year Member

joined:June 5, 2009
posts:252
votes: 1


I am not too technical with this so bear with me please. If I change the permalink to the post name from the date and name as it is currently, the search engines will still see it as the same url, right? I don't wish to undo the work done over the years.

As for the second bit, about hiding the date in the search results, I get it, I think. I usually use themes that I buy from one of the theme stores, before customising it a bit. I have edited and updated themes in the header, index, single post files before.

Just want confirmation on the first bit of my query.

Thanks again
6:17 pm on Aug 28, 2015 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

joined:Apr 9, 2011
posts:15504
votes: 749


google will see them as new pages and therefore the value of age, links, etc will diminish

They shouldn't, provided each of your redirects is one-for-one:
oldURL1 >> newURL1
oldURL2 >> newURL2
oldURL3 >> newURL3

Before you start, double-check to make sure the site returns a 404 response whenever you request any invalid URL. If in doubt, test for yourself using LiveHeaders or equivalent. When a search engine-- especially google-- starts meeting a lot of 301s, it will respond by requesting random made-up URLs like "bmjrhjtu7tb6ujh56.html" to make sure the site isn't indulging in "soft 404s". (In google's case, this appears to be fully automated, probably triggered by the number of redirects as a proportion of total requests.)
6:38 pm on Aug 28, 2015 (gmt 0)

Administrator from US 

WebmasterWorld Administrator not2easy is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Dec 27, 2006
posts:4201
votes: 265


If a robot follows a link that has a rewrite that sends it to a different URL, it will be seen as the new address as long as they can't still see it where it used to be, and as long as the rewrite rule uses a 301 (permanent) redirect. That is done frequently when content is moved. Ideally you would try to contact the places where your links are and give them the new address with a request that they update the links. If that can't or won't be done you just need to ensure that the rewrite is properly done using 301 and the old URL cannot be visited. So long as a new URL replaces the old URL and the visitor arrives at the same content it should have no effect.

To check that server is sending a 301 rather than the default 302 (temporary) status for your rewrite, use a tool to check the header responses. I use a browser extension - Live HTTP Headers for FireFox, there are other tools; a free header checker is available from WebmasterWorld: [freetools.webmasterworld.com...] then if you are not seeing a 301, there is help in the Apache Forum here.

Edited to add- I see you got a similar answer from lucy24 while I was writing - that is good advice in addition to checking that the old URL takes you cleanly to the new one.
8:24 am on Aug 29, 2015 (gmt 0)

Full Member

5+ Year Member

joined:June 5, 2009
posts:252
votes: 1



These rewrites and 301 redirects are a bit technical for me. I don't want to edit any code in this case if I don't have to. I don't want to mess anything up. To put simply, If I go into Wordpress admin, click on Permalinks from the left side panel and then change it from the current setting which is date and name to just the name, will this be enough for the visitors to be directed to the new url but for the search engines to treat it as the old url? If it requires anything other than changing the option under Permalinks, which is fairly straightforward to do, it will be probably best I hire a web developer to make the edits.
2:28 pm on Aug 29, 2015 (gmt 0)

Administrator from US 

WebmasterWorld Administrator not2easy is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Dec 27, 2006
posts:4201
votes: 265


Changing the appearance of your links in the settings can be done as you describe, but that is only half of the task. Visitors and robots will not automatically land on the new URL when they click an old link. The rewrite rules need to be added to your htaccess file and then tested as described.

If you are not comfortable with that you have options: you can hire someone (I would still test the results) or you can use a plugin (and test) or you can rethink the change. The URL structure may not be what you wish you had done, but it has no ill effect for your site. If the part you are concerned about is seeing the dates in the search results, that only needs the css edit.
8:31 pm on Aug 29, 2015 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

joined:Apr 9, 2011
posts:15504
votes: 749


.entry-meta {
display: none !important;
}

Would that keep the text from being visible in search results? Seems like it would only suppress display in the place where you do want it to be seen: by humans reading your page. (If you don't want anyone to see it, whether human or search engine, why is it even there? Can't you change a setting to keep it from being included at all?)
10:23 pm on Aug 29, 2015 (gmt 0)

Administrator from US 

WebmasterWorld Administrator not2easy is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Dec 27, 2006
posts:4201
votes: 265


If it isn't shown on the page, it wouldn't be included in search results, unless it is submitted some other way(?). There are so many things in WP that can be changed either in the theme or by the use of plugins that this was suggested. It is a basic, simple edit that would apply to any setup. There are many ways to remove the date depending on theme/plugins in use, the css fix is generic. It was suggested because Automotive would prefer that visitors not see the date.

Hiding or disabling the Post/Page meta is a pretty common practice, especially on evergreen informational content.