1 00:00:00,000 --> 00:00:02,230 [treehouse presents] 2 00:00:02,230 --> 00:00:05,760 [Quick Tips:Customizing Permalinks in WordPress with Zac Gordon] 3 00:00:05,760 --> 00:00:07,730 Hi, I'm Zac. 4 00:00:07,730 --> 00:00:10,180 In this Treehouse quick tip, we're gonna talk about 5 00:00:10,180 --> 00:00:14,260 how to customize what the URLs look like on a WordPress site. 6 00:00:14,260 --> 00:00:17,900 WordPress uses a term Permalinks to refer to the URL 7 00:00:17,900 --> 00:00:20,870 for a specific page or post on the site. 8 00:00:20,870 --> 00:00:25,000 Having good Permalinks makes links to your site easier for people to read 9 00:00:25,000 --> 00:00:27,880 and easier for search engines to index. 10 00:00:27,880 --> 00:00:29,990 Let's take a look at some of what's possible 11 00:00:29,990 --> 00:00:32,659 with Permalinks and WordPress. 12 00:00:32,659 --> 00:00:39,440 Start in the admin area and go to Settings, Permalinks. 13 00:00:39,440 --> 00:00:42,680 You can see that by default WordPress displays pages 14 00:00:42,680 --> 00:00:49,790 with a question mark, P=, and then the ID of the page or post you're looking at. 15 00:00:49,790 --> 00:00:51,890 While this is technically clean, 16 00:00:51,890 --> 00:00:56,150 it's not that friendly for humans or search engines. 17 00:00:56,150 --> 00:01:00,970 You can see that the next two options--day and name and month and name-- 18 00:01:00,970 --> 00:01:05,780 display the year, month, and date; or just the year and month 19 00:01:05,780 --> 00:01:10,420 as well as the name and the title of the post. 20 00:01:10,420 --> 00:01:14,120 These two options are great for blogs or for newspapers 21 00:01:14,120 --> 00:01:18,350 or for sites that want the month and the name and the year 22 00:01:18,350 --> 00:01:22,020 to be in the URL of the posts. 23 00:01:22,020 --> 00:01:26,270 The next option down, Numeric, is similar to the first option 24 00:01:26,270 --> 00:01:30,970 in that it shows the post id number at the end of the link 25 00:01:30,970 --> 00:01:36,640 but it doesn't include the ?P, and instead just says archives. 26 00:01:36,640 --> 00:01:39,480 If you want your site to have the id number 27 00:01:39,480 --> 00:01:41,470 of the post and page in the URL 28 00:01:41,470 --> 00:01:45,860 then this is a slightly cleaner and nicer option than to default setting. 29 00:01:45,860 --> 00:01:49,940 This last option here, Post name, is probably one of the most common, 30 00:01:49,940 --> 00:01:53,750 especially for sites that are using WordPress for more of a CMS 31 00:01:53,750 --> 00:01:57,520 and not just for a blog engine. 32 00:01:57,520 --> 00:02:02,700 It could also be useful for blogs that only want to have the title of the URL 33 00:02:02,700 --> 00:02:06,940 in the links and not have anything about when that article was published. 34 00:02:06,940 --> 00:02:11,070 You could see that as we select any of these it updates 35 00:02:11,070 --> 00:02:15,370 the custom structure field below. 36 00:02:15,370 --> 00:02:19,030 If you want a certain Permalinks structure that is not here, 37 00:02:19,030 --> 00:02:23,490 you can click on "a number of tags are available" link here 38 00:02:23,490 --> 00:02:27,310 and see all of the possible options that you have. 39 00:02:27,310 --> 00:02:30,940 For this situation we're just gonna select Post name 40 00:02:30,940 --> 00:02:33,860 and then click Save Changes. 41 00:02:33,860 --> 00:02:37,360 You can see it now says "Permalink structure updated," 42 00:02:37,360 --> 00:02:39,900 which tells us that everything has been saved 43 00:02:39,900 --> 00:02:44,300 and our site is now using this format for the URLs. 44 00:02:44,300 --> 00:02:47,220 If you save your changes and you see a message that says, 45 00:02:47,220 --> 00:02:52,540 "You should update your htaccess now," and if you scroll down to the page, 46 00:02:52,540 --> 00:02:56,400 it gives you the content that should go inside of this htaccess file. 47 00:02:56,400 --> 00:02:59,010 Now you have one more step to do. 48 00:02:59,010 --> 00:03:04,770 For directions on how to do that, click on this link "A number of tags are available" 49 00:03:04,770 --> 00:03:07,720 and then on the WordPress documentation page 50 00:03:07,720 --> 00:03:11,680 find where it says "Where is my htaccess file?" 51 00:03:11,680 --> 00:03:14,540 and follow those directions there. 52 00:03:14,540 --> 00:03:17,750 And that's how you format Permalinks and WordPress. 53 00:03:17,750 --> 00:03:20,370 Experiment with what works best for your site 54 00:03:20,370 --> 00:03:23,020 Remember that if you have the post name and the URL 55 00:03:23,020 --> 00:03:26,360 then you want to make sure you have strong key words in your title names 56 00:03:26,360 --> 00:03:29,010 to help with your search engine optimization.