LearnCustomizing Permalinks in WordPress | Treehouse Quick TIp


Zac Gordon
writes on March 14, 2013

In this Quick Tip, Treehouse WordPress teacher Zac explains the options you have when choosing your WordPress site’s URLs. Choosing the right permalink structure can have an amazing effect on your website’s SEO value. Do you have a blog or news site where a date-based permalink structure would work best? Or do you need those all important title keywords in the URL? Find out in this helpful tutorial from Treehouse.

Connect with Treehouse!
Website: http://www.teamtreehouse.com
Twitter: http://trhou.se/treehouse-twitter
Facebook: http://trhou.se/treehouse-facebook
Google+: http://trhou.se/treehouse-google-plus

Each week, we’ll release:

– New episodes of ‘The Treehouse Show’ – up to date news and tips on web design, coding, and more.
– ‘Quick Tip’ videos – these are short how-to videos on today’s most relevant web technologies.
– and much more!

Video Transcription

Hi, I’m Zac. In this Treehouse Quick Tip, we’re going to talk about how to
customize what the URLs look like on a WordPress site. WordPress uses this
term “permalinks” to refer to the URL for a specific page or post on the
site. Having good permalinks makes links to your site easier for people to
read and easier for search engines to index. Let’s take a look at some of
what’s possible with permalinks in WordPress.

Start in the admin area and go to Settings, Permalinks. You can see that by
default WordPress displays pages, the ?p= and then the ID of the page or
post you’re looking at.
While this is technically clean, it’s not that friendly for humans or
search engines.

You can see that the next two options, Day and Name, and Month and Name,
display the year, month, and date or just the year and month as well as the
name and the title of the post. These two options are great for blogs or
for newspapers or for sites that want the month and the name and the year
to be in the URL of the posts.

The next option down, Numeric, is similar to the first option in that it
shows the post ID number at the end of the link, but it doesn’t include the
?p and instead just says archives. If you want your site to have the ID
number of the post and page in the URL, then this is a slightly cleaner and
nicer option than the default setting.

This last option here, Post Name, is probably one of the most common,
especially for sites that are using WordPress for more of a CMS and not
just for a blog engine. It could also be useful for blogs that only want to
have the title of the URL in the links and not have anything about when
that article was published. You could see that as we select any of these,
it updates the custom structure field below.

If you want a certain permalink structure that is not here, you can click
on “A number of tags are available” link here and see all of the possible
options that you have.

For this situation, we’re just going to select Post Name and then click
Save Changes. You can see it now says “Permalink structure updated,” which
tells us that everything has been saved and our site is now using this
format for the URLs.

If you save your changes and you see a message that says “You should update
your HT access now” and if you scroll down to the page, it gives you the
content that should go inside of this HT access file, then you have one
more step to do. For directions on how to do that, click on this link “A
number of tags are available,” and then on the WordPress documentation page
find where it says “Where is my HT access file,” and follow those
directions there.

And that’s how you format permalinks in WordPress. Experiment with what
works best for your site. Remember that if you have the post name in the
URL, then you want to make sure you have strong keywords in your title
names to help with your search engine optimization.

If you’d like to see more advanced videos and tutorials like this one, go
to TeamTtreehouse.com and start learning for free.

2 Responses to “Customizing Permalinks in WordPress | Treehouse Quick TIp”

  1. Hey Zac, big fan love the lessons. I’m a premium member but i don’t see any place to ask a simple question regarding building a custom theme. I have viewed all the videos more than 5 times and the only thing i don’t understand is how do the permalinks from your work.php page know to render the single-work page structure. Since single-work.php is not setup as a template? I see that work.php is a template and that’s how your styled that page but the question as to how individual work pages knows to use the single-work.php file alludes me. Is this some internal core code logic? Because if so i have replicated this concept on a site i’m working on where neighborhood.php uses a template and single-neighborhood.php doesn’t but when i link (from a permalink) to a neighborhood it doesn’t render the single-neighborhood.php template, any suggestion why this might be the case.

    To add some background detail to the matter, i created each neighborhood as a page that doesn’t use a template (because in your example you don’t actually give the single work pages a template, or at least you don’t show that part). In fact you don’t show how you created your single work page files which leads me to believe they just are generated dynamically from your CPT posts and use the single-work.php to render them. So my question is how do you make the permalink from work page(in this case Neighborhood page) link to the CPT post that calls on the single-work.php to render it? That’s what i can’t figure out.

    Thanks I hope as a premium member i can at least get one answer:)

    Keep up the awesome work it’s truly great!

  2. Fred Lunjevich on July 29, 2013 at 6:18 pm said:

    Hey Zac, This was a good overview of how to change permalink structures. The problem for me, however, is that every time I have tried doing this it always results in an error. I change the structure then go to the page only to be told “page does not exist on this server”. Nowhere do I get an alert to update the .htacess file.

    If it was as simple as you point out in the video, what could possibly be going wrong here? I follow the instructions to the letter yet the result is always the same: failure. I suspect others have this problem too.

Leave a Reply

You must be logged in to post a comment.

man working on his laptop

Are you ready to start learning?

Learning with Treehouse for only 30 minutes a day can teach you the skills needed to land the job that you've been dreaming about.

Start a Free Trial
woman working on her laptop