bloginfo()WP 0.71

Displays information about the current site.

Displays information about your site, mostly gathered from the information you supply in your User Profile and General Settings WordPress Administration Screens. It can be used anywhere within a template file. This always prints a result to the browser. If you need the values for use in PHP, use get_bloginfo().

For newbies

For those who do not know yet, I want to dispel the myth that getting data through this function leads to excessive load on the hosting. In fact, nothing of the sort! Once I thought so too, but after a series of tests I made sure that the load would be barely noticeable if through this function you get about 5 thousand data. Therefore, do not believe if someone says that bloginfo() or get_bloginfo() overload the server!

If you do not specify the $show parameter, the blog name will be displayed. If you specify not known values, the name of the blog will be displayed too.

1 time — 0.00021 sec (fast) | 50000 times — 6.78 sec (fast)

No Hooks.


null. Nothing (null).


bloginfo( $show );

Site information to display. Possible values:

  • name - Site title.
  • description - Site description.
  • template_url - URL of the active theme’s directory.
  • stylesheet_url - Primary CSS (usually style.css) file URL of the active theme.
  • rss2_url - RSS 2.0 feed URL (/feed).
  • comments_rss2_url - Comments RSS 2.0 feed URL (/comments/feed).
  • pingback_url - Pingback XML-RPC file URL (xmlrpc.php).
  • charset - Charset encoding of the website. Note: This parameter always echoes UTF-8, which is the default encoding of WordPress.
  • version - WordPress Version you use.
  • html_type - Content-Type of WordPress HTML pages (default: “text/html”).
  • language - Language of WordPress, for example, en-US.
Rarely used:
  • stylesheet_directory - Stylesheet directory URL of the active theme. Better use get_stylesheet_directory_uri() instead.
  • template_directory - Stylesheet directory URL of the active theme. Better use get_template_directory() instead.
  • admin_email - “E-mail address” set in Settings > General.
  • rdf_url - RDF/RSS 1.0 feed URL (/feed/rfd).
  • rss_url - RSS 0.92 feed URL (/feed/rss).
  • atom_url - Atom feed URL (/feed/atom).
  • url - URL of the website (WordPress address (URL) in Settings > General). Same as home_url().
  • wpurl - WordPress URL (WordPress address (URL) in Settings > General). Same as site_url().
  • home - Deprecated since version 2.2. Use home_url() instead.
  • siteurl - Deprecated since version 2.2. Use site_url() instead.

Default: ''



#1 Display the site name in <h1> tag:

<h1><?php bloginfo('name'); ?></h1>

#2 Display the encoding of the site:

<p>Charset: <?php bloginfo('charset'); ?></p>

#3 Display the description of the site:

<p><?php bloginfo('description'); ?> </p>

#4 bloginfo() vs get_bloginfo()

If using bloginfo() as a variable, for example: $url = bloginfo('url'); it will return null.

This is because bloginfo() echos the result immediately. So if you want to use any of the bloginfo() as variables use get_bloginfo(). This function returns the result as a string.


#5 Example output

In this example case, the Site Address (URL) is shown as, and the WordPress address (URL) is displayed as

Please note that directory URLs are missing trailing slashes.

admin_email          = [email protected]
atom_url             =
charset              = UTF-8
comments_atom_url    =
comments_rss2_url    =
description          = Just another WordPress blog
home                 = (DEPRECATED! use url option instead)
html_type            = text/html
language             = en-US
name                 = Testpilot
pingback_url         =
rdf_url              =
rss2_url             =
rss_url              =
siteurl              = (DEPRECATED! use url option instead)
stylesheet_directory =
stylesheet_url       =
template_directory   =
template_url         =
text_direction       = ltr
url                  =
version              = 3.5
wpurl                =

#6 Hides description if empty

Practical example that could be used in themes.

<?php if ( $desc = get_bloginfo( 'description' ) ) { ?>
	<a class="site-description"><?= $desc ?></a>
<?php } ?>



Since 0.71 Introduced.

bloginfo() code WP 6.5.4

function bloginfo( $show = '' ) {
	echo get_bloginfo( $show, 'display' );