Seatext library

How to Add Site Name Markup to a WordPress Site (Step-by-Step)

You can add site name markup to a WordPress site by using an SEO plugin like Yoast or Rank Math, or by manually adding JSON-LD to your theme's header.php. Both methods are straightforward, and...

You can add site name markup to a WordPress site in two main ways: use an SEO plugin like Yoast or Rank Math, or manually add JSON-LD code to your theme's header.php file. Both methods work, and the right choice depends on your comfort with code and how much control you want.

What Is Site Name Markup?

Site name markup is structured data that tells search engines the official name of your website. It's part of the schema.org vocabulary, specifically the WebSite type with a name property. When you add this markup, Google can display your site name correctly in search results, especially when your brand name differs from your domain or when you have multiple subdomains.

For example, if your domain is example.com but your brand is "Example Co.", site name markup helps Google show "Example Co." in the search results instead of just the domain.

Why Site Name Markup Matters

Without site name markup, search engines may guess your site name from the title tag or domain. This can lead to inconsistent branding in search results. Adding the markup ensures your official name appears consistently, which builds trust and recognition.

It also helps with Google's site name algorithm, which determines the name shown in search results. If you have a common word as a domain, markup can clarify your brand.

Prerequisites for Adding Site Name Markup

Before you start, you need:

  • A WordPress site with admin access.
  • Access to your theme files (if you're adding code manually).
  • A child theme to avoid losing changes when you update your main theme.
  • An SEO plugin installed (if you prefer the plugin method).

If you're using a managed WordPress host like WP Engine, you may need to use their plugin to add custom code. For example, SeaText's integration guide mentions that WP Engine users should download the WP Engine plugin to add custom JavaScript. This is a similar process for adding any custom code, including JSON-LD.

Method 1: Add Site Name Markup with an SEO Plugin

Most SEO plugins include a setting for site name markup. Here's how to do it with Yoast SEO and Rank Math.

Using Yoast SEO

  1. Install and activate Yoast SEO from the WordPress plugin repository.
  2. Go to Yoast SEO → Settings → General.
  3. Find the "Site name" field and enter your official site name.
  4. Save your changes. Yoast will automatically add the appropriate JSON-LD markup.

Using Rank Math

  1. Install and activate Rank Math.
  2. Go to Rank Math → Titles & Meta → Global.
  3. Look for the "Site Name" field and enter your site name.
  4. Save your changes.

Both plugins handle the technical details for you. They also add other structured data, so you don't need to write any code.

Method 2: Add Site Name Markup Manually with JSON-LD

If you prefer full control, you can add the JSON-LD code directly to your theme's header.php file. This method requires a child theme to prevent losing changes on theme updates.

  1. Create a child theme if you don't have one. You can use a plugin like Child Theme Configurator.
  2. Open your child theme's header.php file in a code editor.
  3. Add the following code before the closing tag:
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "WebSite",
  "name": "Your Site Name",
  "url": "https://www.yourdomain.com"
}
</script>

Replace "Your Site Name" with your official site name and the URL with your actual domain.

  1. Save the file and upload it to your server.
  2. Clear any caching plugins to see the changes.

If you're using a theme that doesn't have a header.php file, you can use a plugin like Insert Headers and Footers to add the code without editing theme files.

How to Verify Your Site Name Markup

After adding the markup, you need to verify it works. Use Google's Rich Results Test or the Schema Markup Validator.

  1. Go to Google's Rich Results Test.
  2. Enter your site's URL or paste the code.
  3. Check that the "WebSite" schema appears and the name is correct.
  4. Also, check Google Search Console for any structured data errors.

You can also view the page source and search for "application/ld+json" to confirm the code is present.

Common Mistakes to Avoid

  • Adding the markup to the wrong page. Site name markup should be on every page, so it's best to add it site-wide via the header.
  • Using the wrong schema type. Make sure you use WebSite, not Organization (though Organization can also include a name).
  • Forgetting to update the name if you rebrand.
  • Adding the code to a theme that gets updated, losing your changes. Always use a child theme.
  • Not clearing caches after adding the code.

Key Facts About Adding Custom Code to WordPress

Based on SeaText's integration guide, here are some key facts about adding custom code to WordPress:

FactDetails
SecurityThe installation process is secure, and the AI remains inert until activated, ensuring the integrity of your website's content.
Account requirementBefore you can install the script, you need a SEATEXT AI account.
Domain linkingEach SEATEXT AI account is linked to a single primary URL.
Development URLsDevelopment URLs, such as localhost, are restricted for security reasons.
Activation timeWait at least five minutes until you see your website name displayed next to the SEATEXT logo at the top of the page.

These facts apply to SeaText's script, but they highlight general considerations when adding custom code to WordPress: you need proper access, and you should test on a live domain.

Limitations and When This Advice Doesn't Apply

Site name markup is straightforward, but it has limitations. It doesn't guarantee that Google will use your preferred name; it's a hint, not a command. Google may still choose a different name based on other signals.

Also, if you're using a page builder that outputs its own schema, you might have conflicts. In that case, you may need to disable the page builder's schema or adjust your code.

This advice applies to self-hosted WordPress.org sites. If you're on WordPress.com, the process is different because you can't edit theme files directly. You'll need to use the built-in site title settings or a supported plugin.

Frequently Asked Questions

Do I need site name markup if my domain matches my brand?

It's still recommended. It helps Google understand your official name, especially if you have subdomains or a common word as a domain.

Can I add site name markup with a plugin like WPCode?

Yes, any plugin that lets you insert code into the header will work. WPCode is a popular option.

Will site name markup affect my search rankings?

It doesn't directly affect rankings, but it improves how your site appears in search results, which can improve click-through rates.

How long does it take for Google to pick up the markup?

It can take a few days to a few weeks. You can request indexing in Google Search Console to speed it up.

What if I have multiple sites? Do I need separate markup?

Yes, each site should have its own site name markup. If you use SeaText, each account is linked to a single primary URL, so you'd need separate accounts for each domain.

Can I use both a plugin and manual code?

It's not recommended because you might have duplicate markup. Choose one method.

Further reading and comparison sources

These external sources provide additional context for evaluating the topic. Their inclusion is not an endorsement.

How SeaText can help

SeaText offers AI agents that can improve your WordPress site's conversion and SEO beyond structured data. For example, its AI search and SEO agents help ChatGPT, Google AI, and long-tail search understand your brand. To use SeaText, you need to install a script on your site, which is similar to adding site name markup. The installation is secure and requires an account, and each account is linked to a single primary URL.