SEO for a Developer Portfolio: Metadata, Sitemaps, and Structured Data
Build a Developer Portfolio · Part 8 of 9
- #Portfolio
- #personal-website
- #seo
- #structured-data
- #search-console
A portfolio doesn't need to rank for "Java developer". Nobody's does. It needs to come up first when someone searches your name, to show a decent preview when a recruiter pastes the link into a chat, and to give each blog post a fair shot at the specific questions it answers. That's what portfolio website SEO is for, and most of it is a short list of things that are either correct or broken, plus patience.
This post goes through that list using this site as the worked example:
what each page puts in its <head>, how the sitemap is built, which
structured data it ships, how the build refuses to deploy a page that's
missing any of it, and what Search Console showed in the first two months.
The numbers are real, and small.
If you haven't deployed yet, Part 7 covers getting the site onto your own domain. Some of what follows depends on that being right, especially having exactly one hostname.
What matters and what doesn't
For a personal site, the things that move the needle are boring:
- Every page has its own title and description. Not the same ones copied across the site.
- Every page says which URL is the real one (the canonical), and that URL actually answers with a 200.
- The metadata is in the HTML the server sends, so anything that reads your page without running JavaScript sees it too.
- There's a preview image that social networks can render.
- Search engines can find every page: a sitemap, a
robots.txtthat doesn't block anything important, and links between your pages. - Someone checks. Search Console, a few minutes every couple of weeks.
And some things you can skip:
<meta name="keywords">. Google has ignored it for well over a decade.<priority>and<changefreq>in the sitemap. Google says it ignores both.<lastmod>is used, but only if it's accurate.- Keyword density. Use the phrase people would search for in the title, the first paragraph and one heading. After that, write normally.
- Paid "SEO audits" for a five-page site. Everything they'd flag is in this post.
Per-page metadata: title, description, canonical
These three are the core of portfolio website SEO. The title becomes the blue link in search results and the tab label. The description is a candidate for the snippet under it (Google may write its own instead). The canonical tells search engines which URL to index when the same content is reachable at more than one.
On this site, every route renders one <Seo> component, and React 19
moves the tags it renders into <head>. Trimmed down, it looks like this:
export function Seo({ title, description, path, image, jsonLd }: SeoProps) {
const url = SITE_URL + path;
const fullTitle = `${title} — ${SITE_NAME}`;
const ogImage = socialImageUrl(image ?? DEFAULT_OG_IMAGE);
return (
<>
<title>{fullTitle}</title>
<meta name="description" content={description} />
<link rel="canonical" href={url} />
<meta property="og:title" content={fullTitle} />
<meta property="og:description" content={description} />
<meta property="og:url" content={url} />
<meta property="og:image" content={ogImage} />
<meta name="twitter:card" content="summary_large_image" />
{jsonLd && (
<script type="application/ld+json">
{JSON.stringify(jsonLd).replace(/</g, '\\u003c')}
</script>
)}
</>
);
}
The real one also handles hreflang links, noindex for the 404 page,
article:* tags for posts and the image dimensions, but that's the shape.
Whatever your stack, you want the same thing: one place that every page
goes through, so no page can forget its title.
A few rules that save you trouble later:
- Make the canonical absolute and exact.
https://example.dev/about, not/about, and with the same hostname and trailing-slash style your server actually answers with a 200. A canonical that points at a URL which redirects is a mixed signal. - Put the page first in the title, the site name second. "SEO for a Developer Portfolio — José Alencar Rocha", not the other way around. The home page is the exception: there, your name is the page.
- Front-load the description. Google cuts snippets at roughly 150 to 160 characters (it's measured in pixels, not characters). Whatever matters goes in the first sentence.
- Escape
<in inline JSON-LD. Thatreplaceabove stops a post title containing</script>from closing the tag early. It's one line, so just do it.
Make sure the metadata is in the HTML
This is where single-page apps get caught out, and this site was one for its first two months. Part 5 covers the trade-off in detail; here's the short version.
If your title, description and og: tags are added by JavaScript after
the page loads, the HTML your server sends contains only the fallback ones
from index.html. Google runs JavaScript, so it eventually sees the real
tags, in a second rendering pass. Most other readers don't. LinkedIn,
Slack, WhatsApp, X and Facebook build link previews from the raw HTML, so
every page on a client-rendered site previews as the home page.
The fix is to put the finished HTML in the response: a static site
generator, server rendering, or prerendering at build time. This site
moved to prerendering on 6 November 2026 (React Router's framework mode
with ssr: false), so every page is now an HTML file with the real
<title>, tags and article text in it, and React takes over in the
browser.
Whatever you use, check it with something that doesn't run JavaScript:
curl -s https://josealencar.dev/blog/deploy-portfolio-cloudflare-pages \
| grep -o '<title>[^<]*</title>\|<link rel="canonical"[^>]*>\|<meta property="og:image"[^>]*>'
# <title>Deploying a Portfolio on Cloudflare Pages: … — José Alencar Rocha</title>
# <link rel="canonical" href="https://josealencar.dev/blog/deploy-portfolio-cloudflare-pages"/>
# <meta property="og:image" content="https://josealencar.dev/blog/deploy-portfolio-cloudflare-pages/og.png"/>
If curl shows the page's own title, link previews will too. If it shows
your site-wide fallback, they won't, however good it looks in the browser.
Open Graph and the preview image
The preview card someone sees when your link is pasted into a chat comes
from four tags: og:title, og:description, og:url and og:image.
Add twitter:card set to summary_large_image and X uses the same data
with a large image.
The image is where most portfolios go wrong, and this site did too. The
social images here are drawn as SVG, because SVG is easy to keep in git
and to match to the site's style. But LinkedIn, X and Facebook don't
render SVG for og:image. Until that was fixed, a link to any post here
would have shown up on LinkedIn with no image at all.
The fix kept the SVGs as the source. A post-build script renders every
og*.svg to a PNG next to it, using fonts committed to the repository
rather than whatever the machine has installed, and <Seo> points
og:image at the .png. So authors still write
image: /blog/my-post/og.svg and never think about it.
What to aim for:
- 1200 × 630 PNG or JPEG, with the important text away from the edges. Some apps crop it to a square.
- An absolute URL in
og:image. Relative URLs are a common reason a preview shows no image. og:image:widthandog:image:height, so the first person to share a link gets the image, rather than a card without one while the network fetches it.- Test with the networks' own tools. LinkedIn's Post Inspector and Facebook's Sharing Debugger show what they see, and let you refresh a cached preview after you fix something.
Structured data that's worth adding
Structured data is a JSON-LD block that tells search engines, in a fixed vocabulary from schema.org, what the page is about. For a portfolio, three types cover it:
WebSiteandPersonon the home page.WebSitehelps Google pick the site name it shows above your results.Personties your name to your job title, your employer and your profiles elsewhere (sameAswith your GitHub and LinkedIn URLs).ProfilePageon the about page, with the samePersonas its main entity.BlogPostingon each post: headline, description, dates, author, image.
This is what the previous part of this series ships, straight from the live HTML (description shortened):
{
"@context": "https://schema.org",
"@type": "BlogPosting",
"headline": "Deploying a Portfolio on Cloudflare Pages: Custom Domain, HTTPS, and www Redirect",
"description": "How to deploy a portfolio on Cloudflare Pages from GitHub Actions…",
"datePublished": "2026-11-12",
"dateModified": "2026-11-12",
"author": {
"@type": "Person",
"name": "José Alencar Rocha",
"url": "https://josealencar.dev/about"
},
"mainEntityOfPage": "https://josealencar.dev/blog/deploy-portfolio-cloudflare-pages",
"image": "https://josealencar.dev/blog/deploy-portfolio-cloudflare-pages/og.png",
"articleSection": "Build a Developer Portfolio"
}
Set your expectations, though. None of this gets you stars or a special box in the results. Google's Article markup has no required properties at all; it helps Google read the author, dates and image correctly, and that's the whole benefit. Add it because it's cheap, generated from data you already have, and then leave it alone. Validate it once with Google's Rich Results Test or the Schema Markup Validator, and make sure every value in it is also visible on the page: structured data that says something the page doesn't is the kind Google ignores, or penalises.
Sitemap and robots.txt
A sitemap is a list of the URLs you want indexed. On a site with a handful of pages and good internal links, Google would find them anyway, so the sitemap mostly earns its keep in Search Console: you submit it once, and the indexing reports start telling you which of your URLs are and aren't indexed.
The rule that matters is that the sitemap and your real pages must come from the same list. On this site there's one function that lists every public route (the static pages plus every non-draft post, per language), and three things use it: the prerender step, the sitemap generator and the post-build checker. A post can't be prerendered and missing from the sitemap, or the other way round.
The generator writes one <url> per page and language, with the post's
date as <lastmod> and hreflang alternates for the other language:
<url>
<loc>https://josealencar.dev/blog/deploy-portfolio-cloudflare-pages</loc>
<lastmod>2026-11-12</lastmod>
<xhtml:link rel="alternate" hreflang="en" href="https://josealencar.dev/blog/deploy-portfolio-cloudflare-pages" />
<xhtml:link rel="alternate" hreflang="pt-BR" href="https://josealencar.dev/pt-br/blog/deploy-portfolio-cloudflare-pages" />
</url>
And robots.txt is three lines:
User-agent: *
Allow: /
Sitemap: https://josealencar.dev/sitemap.xml
That's all a portfolio needs. Don't Disallow your JavaScript or CSS:
Google needs them to render the page. And remember that robots.txt
controls crawling, not indexing. To keep a page out of the results, give
it a noindex tag and let it be crawled, or don't publish it.
hreflang, if your site has two languages
This site is in English and Brazilian Portuguese, so every page also says where its translation lives:
<link rel="alternate" hreflang="en" href="https://josealencar.dev/blog/deploy-portfolio-cloudflare-pages"/>
<link rel="alternate" hreflang="pt-BR" href="https://josealencar.dev/pt-br/blog/deploy-portfolio-cloudflare-pages"/>
<link rel="alternate" hreflang="x-default" href="https://josealencar.dev/blog/deploy-portfolio-cloudflare-pages"/>
Three rules keep it working. The links must be reciprocal: the English
page lists the Portuguese one and the Portuguese page lists the English
one, each including itself. x-default names the version for
everyone else. And only list translations that exist: posts here can
ship in one language, and those pages list only that one, with the
canonical pointing at the language the content is really in. Part 9 goes
into the bilingual side in depth.
Let the build check it
Every item above can quietly break in a refactor, and nothing visible breaks with it: the page looks the same, and you find out weeks later in Search Console, or never. So this site's build checks the output and fails if anything is missing.
The checker reads every prerendered page back and fails the build if a
page has anything other than exactly one <title>, no <h1>, no
og:title, an og:image that's an SVG or a PNG that isn't 1200 × 630, a
canonical that isn't the page's own URL, the wrong <html lang>, or
JSON-LD that doesn't parse. It's about 150 lines of plain JavaScript
with regular expressions, not a framework. On a five-page site you could
do the same with a dozen lines of grep in CI.
Search Console: set it up on day one
Google Search Console is free and it's the only place that shows what Google actually did with your site: which pages it indexed, which it skipped and why, and what people searched for when your pages came up.
- Add a property. A Domain property covers every subdomain and
protocol, and needs a DNS TXT record to verify. A URL-prefix
property covers one origin (say
https://josealencar.dev/) and can be verified with an HTML file, a meta tag or your Google Analytics tag. This site uses a URL-prefix property. Either is fine for a portfolio, as long as the prefix matches your canonical hostname exactly. - Submit the sitemap under Sitemaps. It should show "Success" and a count of discovered URLs that matches yours.
- Use URL Inspection on a few pages. It shows whether a URL is indexed, which canonical Google chose (not always yours), and the HTML Google rendered. "Request indexing" on a new page can speed up its first crawl. It doesn't speed up ranking.
- Read the Pages report every couple of weeks. The two statuses you'll see on a new site are "Discovered – currently not indexed" (Google knows the URL and hasn't crawled it yet) and "Crawled – currently not indexed" (it crawled the page and decided not to index it for now). Both are normal on a young site. If the same pages stay there for months, link to them from your stronger pages.
A realistic timeline, with real numbers
This is the part that tutorials skip. Here's what this site's Search Console showed, from the SEO log kept for it:
- Indexing takes weeks. Metadata and the sitemap shipped on 8 September 2026. The first impressions show up in Search Console's data from mid-September. By 23 October, 92 pages were indexed, and by the end of October, 107.
- Some pages wait. On 23 October, 6 pages (three posts, in both languages) were "Crawled – currently not indexed". Nothing was wrong with them; they were new.
- Traffic stays small for a while. In the 28 days to 19 October: 354 impressions and 2 clicks. In the 28 days to 10 November: 877 impressions, 12 clicks, a 1.4% click-through rate and an average position of 13.8. That's growth, and it's still a few clicks a week.
- New posts start far down. When the posts in this series first got impressions, a query like "how to build developer portfolio" had them around position 50, and the site's newest pages sat anywhere from 26 to 85. A post usually needs a few months before its position means much.
So set your expectations in weeks for indexing and months for ranking. And measure the right thing: for a portfolio, the most important search is your own name, and that one should work within the first few weeks. Everything else is a bonus that grows with how much you write.
Known gaps on this site
None of this is finished, and pretending otherwise would be odd in a post about checking your work:
- Descriptions are too long. Each post's excerpt doubles as its meta
description, and the excerpts here run to 300 or 400 characters because
they're also the summaries on the blog page. Google shows the first 150
or so, which is why the keyword sits early in each one. A separate,
shorter
descriptionfield would be cleaner. dateModifiednever changes. Posts get edited after publishing (new sections, better titles), but the structured data and the sitemap's<lastmod>still use the publish date. That's honest about when the post first appeared and wrong about when it last changed.- Most traffic comes from queries Search Console doesn't show. Low volume queries are hidden for privacy, so most of the 877 impressions above come with no visible search term. With small numbers, you're often guessing which query a page ranked for.
A checklist before you call it done
# Each page's own title, canonical and og:image, without JavaScript
curl -s https://example.dev/about | grep -o '<title>[^<]*</title>\|rel="canonical"[^>]*'
curl -s https://example.dev/about | grep -o 'property="og:image" content="[^"]*"'
# The image is a PNG or JPEG and loads
curl -sI https://example.dev/og.png | grep -i 'content-type'
# Sitemap and robots.txt
curl -s https://example.dev/sitemap.xml | grep -c '<loc>'
curl -s https://example.dev/robots.txt
And outside the terminal:
- The canonical on every page answers with a 200, on the one hostname you picked.
- Pasting a post's link into LinkedIn's Post Inspector shows the right title and image.
- JSON-LD passes the Rich Results Test on the home page and on one post.
- Search Console has the sitemap submitted with no errors.
- A reminder exists to look at Search Console again in two weeks, not tomorrow.
What's next
The site is live, on your domain, and readable by search engines and link previews alike. Part 9, the last in the series, covers making it bilingual without an i18n framework: locale-prefixed URLs, typed dictionaries, and posts that exist in only one language.
If you want the bigger picture of how the pieces fit, the step-by-step plan from Part 3 puts SEO in its place: something you set up during the build and check after launch, not a project of its own.