Does Rank Math save automatically generated alt text in the media library?

The Citead team, updated

In short. Rank Math applies generated alt text at runtime and does not save it in the media library.

Definition: No. Rank Math's Image SEO setting generates a missing alt attribute dynamically when an eligible image is rendered in post or page content. The generated value is not written into the image's Alt Text field in the WordPress media library.

Key facts

  • Rank Math's Image SEO documentation says the Add Missing ALT Attributes feature adds text to images that lack it.
  • The format defaults to %filename%, which uses the file name as the generated value; other variables and static text can also be used.
  • The generated text is applied at runtime, so changing the setting does not change the image's actual stored Alt Text in the WordPress gallery.
  • The setting applies to images in post or page content. Rank Math documents that it does not apply to images in headers, sidebars, or footers.
  • WordPress lists Alt Text as an editable image attribute in the Attachment Details dialog.

How does Rank Math generate the attribute?

The Image SEO module supplies a template for missing alternative text. Rank Math's documentation says the Add Missing ALT Attributes feature automatically adds ALT text to images that do not have it. The setting is available after enabling the Image SEO module in Rank Math SEO → Dashboard → Modules; the image controls are under General Settings → Images.

The template's default value is shown below:

%filename%

The documentation describes this value as the file name used for the ALT text. It also allows variables combined with static text, so the output depends on the configured format and the image context available to that format.

What happens to the media library value?

Rank Math describes the addition as dynamic and says that the actual ALT texts of the images do not change. If the image is checked in the WordPress gallery after the setting is enabled, the image still has no Alt Text there when no value was stored manually. On an actual post, Rank Math applies the ALT text at runtime.

This distinction matches the WordPress documentation's description of the media interface. Its Attachment Details dialog lists Alt Text among the image file's editable attributes, and the same dialog reports that changes made to attachment details are automatically saved. Rank Math's dynamic setting operates at page rendering time, while the media-library field is an attachment detail.

Which images receive the generated value?

The documented scope is narrower than every image on a site. Rank Math says it adds missing ALT attributes only for images added in post or page content. Images used in headers, sidebars, and footers are outside the stated scope.

For a check, compare the two views for one image that has no manually entered Alt Text. The media-library Attachment Details dialog is the stored-field view. The HTML emitted for the image inside post or page content is the runtime view. A value present in the latter with an empty Alt Text field in the former is the behavior described by Rank Math's documentation.

FAQ

Does enabling the setting edit existing media records?

No. Rank Math documents runtime application, while the actual ALT text of the image remains unchanged in the WordPress gallery.

What should you edit when the library must contain alt text?

Edit the image's Alt Text in the WordPress Media Library Attachment Details dialog. That field is an editable image attribute in WordPress's documentation.

No. Rank Math documents the feature for images added in post or page content and excludes images used in headers, sidebars, and footers.

Sources

  1. Rank Math, "Image SEO Options in Rank Math", 25 March 2025
  2. WordPress.org, "Media Library screen", 6 June 2024

Check how a page reads to answer engines. Open the GEO score analyzer

Test a page and see what to fix first

The analysis usually takes less than 10 seconds and needs no account.

400,000+ pages scored in the public benchmark