WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a dilemma, well a new blog which im developing and a few of the posts titles are like this 'Tutorial: Build your first App' or 'Tutorial: Start your business with xensuithia'

I have a page called tutorials that display the posts from this category.

I need the title to not display the 'Tutorial:' part on this page, I tried:

str_replace('Tutorial:',' ', the_title()); 

However it does not work. It just outputs the full title.

share|improve this question
this is not a WordPress question at all. you need to do something like $cut_title = str_replace('Tutorial:',' ', the_title()); echo $cut_title; (I've flagged to close this question) – anu Mar 31 '11 at 14:21
grrr - as Markus points out, it should be get_the_title() – anu Mar 31 '11 at 14:29
Yeah, it is a WP question. It's about the_title() (and by inference, get_the_title(). – Dougal Campbell Mar 31 '11 at 15:31
up vote 4 down vote accepted

That's because the_title() echoes the title. Use this instead:

echo str_replace( 'Tutorial: ', '', get_the_title() );
share|improve this answer
None of these work :'( – Mark Petherbridge Mar 31 '11 at 14:27
What's the problem exactly? – Marcus Kober Mar 31 '11 at 14:33

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.