# How to Change a PDF's Title, Author and Metadata (No Upload)

> Change a PDF's title, author and keywords in the browser, see where each field shows up, and clear the XMP and old-revision copies that many editors miss.

Source: https://www.derar.dev/blog/change-pdf-title-author-metadata · Published 2026-11-19 · By Derar Sattouf

A PDF carries a small set of properties alongside its pages: a title, an author, a subject, keywords, and the names of the programs that made it. You rarely see them, but other people do. The browser tab shows `draft_v3_FINAL` instead of a proper title. A search result shows the file name. Someone opens Document Properties on a contract and finds the name of whoever made the template five years ago.

The quick way to fix it: open the file in the [PDF Metadata Editor](https://www.derar.dev/tools/pdf/edit/metadata), change the fields, save, and download the new copy. The file is read and rewritten inside your browser and is never uploaded.

If you are removing a name for privacy, it helps to know that many PDFs store the same values in two or three places. The editor clears all of them. The second half of this post explains where those copies live, how to check a file for them, and how to do the same cleanup from the command line for a whole folder.

## What PDF metadata contains

Most PDFs keep their properties in a small table called the document information dictionary. These are its fields:

| Field | What it holds | Where people see it |
| --- | --- | --- |
| Title | The document's real name | Browser tabs, the viewer's title bar, search results, screen readers |
| Author | A person or organization | Document Properties, file managers, search tools |
| Subject | A one-line description | Document Properties |
| Keywords | Search terms, usually separated by commas | Document Properties, desktop search |
| Creator | The program the document was written in, such as Microsoft Word | Document Properties |
| Producer | The program that wrote the PDF file | Document Properties |
| Created / Modified | Two dates | Document Properties, file managers |

Many files also carry a second copy of these values in an XMP packet. That is a block of XML inside the PDF that Adobe apps, Microsoft Office and most PDF/A exporters write. It uses its own names for the fields: `dc:title` for the title and `dc:creator` for the author.

## Where the title shows up

The title matters more than the other fields because several programs put it in front of people:

- **Chrome and Edge** show the title in the tab when the file has one, and the file name when it does not.
- **Firefox** uses PDF.js, which reads the XMP `dc:title` first and falls back to the Info title only when there is no XMP title. This becomes important below.
- **Adobe Acrobat and Reader** show the file name in the title bar unless the file asks for the title instead, through a viewer preference called `DisplayDocTitle`.
- **Search engines** can show a PDF's title as the result title. Without one, they fall back to the file name or text from the first page.
- **Screen readers** announce the title when the document opens. WCAG technique PDF18 asks for a title and `DisplayDocTitle` for that reason.

The author is the field people most often want to change or remove. It usually comes from the account that created the original file or template, not from whoever edited it last.

## Change the title and author in your browser

1. Open the [PDF Metadata Editor](https://www.derar.dev/tools/pdf/edit/metadata) and add your PDF. The current title, author, subject, keywords, creator and producer appear in the form.
2. Edit the fields. Write the title as a person would say it, for example "Quarterly report, Q3 2026", not as a file name. Put keywords on one line, separated by commas.
3. To remove a field, clear it.
4. Click **Save Metadata** and download the new file. The original on your disk is not changed.

A few details about what the editor does when it saves:

- It writes the same values to the information dictionary and to the XMP packet, so Firefox and Chrome show the same title. The rest of the XMP packet, such as a PDF/A conformance mark, is kept.
- A field you clear is deleted, not saved as an empty value, in both places.
- Leftovers from earlier saves of the file are dropped from the new copy.
- When you set a title, the editor also sets `DisplayDocTitle`, so Acrobat shows the title instead of the file name.
- The creation date stays as it was, and the modified date is set to the moment you save.
- If you leave Creator or Producer empty, they are set to "PDF Tools".
- Password-protected PDFs are refused rather than saved as blank pages. Remove the password first with the program that set it.

The [other PDF tools](https://www.derar.dev/tools/pdf) on this site work the same way, entirely in the browser. The [PDF Tools case study](https://www.derar.dev/work/pdf-tools) explains how.

## The copies many editors leave behind

### The XMP packet

If the PDF has an XMP packet, changing only the information dictionary leaves the old values in the XML. Two things follow:

- Firefox keeps showing the old title, because it reads `dc:title` first.
- Anyone who opens the file in a text editor or a metadata tool can still read the old author in `dc:creator`.

pdf-lib, which many JavaScript PDF tools are built on, edits only the information dictionary, so any tool that uses it without extra code leaves the XMP copy as it was.

### Earlier revisions of the file

When Acrobat and some other programs save a PDF, they append the changes to the end of the file instead of rewriting it. This is called an incremental update. The old values stay in the earlier part of the file, and anyone who looks at the raw bytes can read them.

ExifTool works this way on purpose. Its [PDF documentation](https://exiftool.org/TagNames/PDF.html) states that its edits are reversible and that old information is never actually deleted from the file. That is useful for undoing a change and a problem when you are trying to remove a name.

## Check what a PDF says about you

PDF.js and Chrome show you only one copy of each field. To see all of them, read the file with [pypdf](https://pypdf.readthedocs.io/):

```python
# pip install "pypdf>=6"
import sys

from pypdf import PdfReader

reader = PdfReader(sys.argv[1])
print("Info:", dict(reader.metadata or {}))

xmp = reader.xmp_metadata
if xmp is None:
    print("XMP: none")
else:
    print("XMP title:", xmp.dc_title)
    print("XMP author:", xmp.dc_creator)
```

Here is the output for a test file with an XMP packet after its title was changed and its author cleared with pdf-lib alone. The information dictionary looks clean, and the XMP packet still has the old title and author:

```text
Info: {'/Producer': 'pdf-lib (https://github.com/Hopding/pdf-lib)', '/Title': 'Quarterly report, Q3 2026', '/Author': '', '/Creator': 'Microsoft Word', '/ModDate': 'D:20261119164020Z', '/CreationDate': 'D:20261119164020Z'}
XMP title: {'x-default': 'draft_v3_FINAL'}
XMP author: ['Jane Original']
```

The same file saved from the Metadata Editor has the new title in both places and no author in either.

The script does not show old revisions. To find those, search the raw file for the name. Values can be stored compressed or as UTF-16, so a plain text search can miss them. Saving the file from the Metadata Editor or with the script below removes them either way.

## Clean a folder of PDFs from the command line

The editor handles one file at a time. For a batch, or as a step in a build, this script sets the title and author in the information dictionary and in the XMP packet, asks viewers to show the title, and writes a new file that contains only the objects the document still uses. That last step drops old revisions:

```python
"""Set a PDF's title and author everywhere they are stored, and drop old revisions.

    pip install "pypdf>=6"
    python set_pdf_metadata.py in.pdf out.pdf "Quarterly report, Q3 2026" "Acme Finance"
    python set_pdf_metadata.py in.pdf out.pdf "Quarterly report, Q3 2026" ""   # no author
"""
import sys

from pypdf import PdfWriter

src, dst, title, author = sys.argv[1:5]

# Cloning copies only the objects the current document still uses,
# so values left behind by earlier incremental saves are not written out.
writer = PdfWriter(clone_from=src)

# 1. The Info dictionary: what Chrome, Acrobat and most file managers read.
info = {"/Title": title, "/Producer": "pypdf"}
if author:
    info["/Author"] = author
writer.metadata = info  # replaces the whole dictionary, so old keys go too

# 2. The XMP packet: what Firefox reads first, if the file has one.
xmp = writer.xmp_metadata
if xmp is not None:
    xmp.dc_title = {"x-default": title}
    xmp.dc_creator = [author] if author else []
    writer.xmp_metadata = xmp

# 3. Ask viewers to show the title instead of the file name in the title bar.
writer.create_viewer_preferences()
writer.viewer_preferences.display_doctitle = True

writer.write(dst)
```

The script was tested on three files: one with an XMP packet, one saved incrementally after an author change, and one with an old information dictionary left over from an earlier revision. The Metadata Editor was tested on a file that has both a compressed XMP packet and a leftover dictionary. In every case, the old author and title were gone from the output, including from compressed streams.

Two things to know before running it on everything:

- Replacing the whole information dictionary also removes the Subject, Keywords, Creator and creation date. Add them to `info` if you want to keep them.
- PDF/A files promise that the information dictionary and XMP agree. The script updates both, so they stay consistent, but run the result through your PDF/A validator if you depend on that status.

## Setting metadata from Node.js with pdf-lib

If you generate PDFs in JavaScript, set the title when you create the file and the problem never starts:

```js
import { readFile, writeFile } from "node:fs/promises";
import { PDFDocument } from "pdf-lib";

const [input, output] = process.argv.slice(2);
const pdf = await PDFDocument.load(await readFile(input));

pdf.setTitle("Quarterly report, Q3 2026", { showInWindowTitleBar: true });
pdf.setAuthor("Acme Finance");
pdf.setKeywords(["quarterly report, finance, 2026"]);

await writeFile(output, await pdf.save());
```

Three details from pdf-lib's behavior:

- `showInWindowTitleBar: true` sets `DisplayDocTitle`, so Acrobat shows the title too.
- `setKeywords` joins the array with spaces, so `["quarterly report", "finance"]` is saved as `quarterly report finance`. Pass one comma-separated string to keep the terms apart.
- pdf-lib replaces the Producer with its own name when it loads a file, unless you pass `{ updateMetadata: false }` to `PDFDocument.load`. It does not touch XMP, so for a file you received from someone else, use the Metadata Editor or the Python script.

## Which way to use

For a single file, use the [Metadata Editor](https://www.derar.dev/tools/pdf/edit/metadata), whether you want a proper title in browser tabs and search results or need a name gone before the file leaves your organization. It takes a minute, clears every copy, and the file stays on your device. For a folder of files, run the Python script. If you generate PDFs in code, set the title, author and `DisplayDocTitle` when you create them, so nobody has to fix them later.
