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

Is it possible to have the site title prepended before each post title, separated by a hyphen? For example:

[my site title] - [my post title]
share|improve this question
up vote 4 down vote accepted
function prepend_site_name($title) {
  return get_bloginfo('name').' - '.$title;

Like that?

share|improve this answer
Ok, thanks. If it can't be done in the WP admin, I'll need to see how this translates into Thesis 2's non PHP platform. – 4thSpace Dec 1 '12 at 17:45
If you don't mind using a plugin, you could install Yoast SEO plugin. This will also add a ton of other SEO features you might not want, so before you install please inform yourself on this plugin. If you do decide to use this plugin anyway: Just enter your desired settings under "SEO >> titels & meta's" In your case: > %%sitename%% - %%title%% – bertkat Dec 11 '12 at 13:11
Given that Yoast SEO simply filters the_title, using the method described in the accepted answer, this really doesn't provide a different answer, and would probably be better as an edit or comment to the accepted answer. – Chip Bennett Dec 11 '12 at 13:14

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.