Archives

Posts Tagged ‘seo’

Jul 19th

No excerpt for pages in WordPress?

2011
No comments | 1447 views


Pages do not offer manual excerpts by default

So, I wanted to add a small modification to my WordPress theme to use the (manual) excerpt as a meta-description tag and found out that there is no way to set the excerpt for pages but only for posts. Really? I found that hard to believe.

The truth is that pages can have excerpts, but they are disabled by default for some unknown reason. I'm sure there is even a valid reason, but I still want to use excerpts for pages.

The solution is actually a one-liner and can be added to any theme.

Read more...

1 Like Like
Tags: ,

May 18th

Changing permalink structure in WordPress

2011
No comments | 1374 views

One thing I didn't know a few years back when I installed WordPress as a newbie was a technical issue with custom permalink structures. I figured that %category%/%postname% looks nice and it also was recommended by many so called SEO experts, so that's what I had chosen.

Now, years later, I have often read that using a non-numeric first element for a custom permalink structure is a very bad idea and the general advice by WordPress experts is to not use %category%, %tag% or %author% but instead %year% or %post_id% .  Even the official codex page does not recommend it.

For performance reasons, it is not a good idea to start your permalink structure with the category, tag, author, or postname fields. The reason is that these are text fields, and using them at the beginning of your permalink structure it takes more time for WordPress to distinguish your Post URLs from Page URLs (which always use the text "page slug" as the URL), and to compensate, WordPress stores a lot of extra information in its database (so much that sites with lots of Pages have experienced difficulties). So, it is best to have at least two path segments in your post's permalink structure such as /%year%/%postname%/ or even /posts/%postname%/

Basically, they are all saying the same: If you have lots of pages, using one of the bad link structures can badly affect the performance.

So, I run some tests to figure out how bad the impact really is.  I wrote a perl script that created "fake content" for a WordPress 3.1 test installation. The script created about 2500 pages with random content, nested only 2 levels deep and another 500 blog articles in 10 categories. This isn't huge - just a blog with 500 posts and 2000 pages - I'm pretty sure there are much bigger sites out there.

Read more...

1 Like Like