WordPress the_modified_author() Function

Beginner
6 min read
Updated: Nov 2026
3 examples
Prints an author name

Definition

In WordPress, the_modified_author() prints the display name of the user who last edited the post. This can be different from the original author.

It is useful for a line like "Last updated by Maria".

Syntax

A few ways to call the_modified_author().

WordPress
<p>Last edited by <?php the_modified_author(); ?></p>
CallWhat it does
the_modified_author()Print the name of the last editor.
get_the_modified_author()Return the name as a string.
the_author()Print the name of the original author.

It prints the name and takes no arguments. Use get_the_modified_author() to return it.

Full declaration
WordPress
the_modified_author(): void

Parameters

ParameterDescription
(none)This function takes no parameters.

Return Value

Return ValueDescription
voidNothing is returned. The name is printed.

WordPress Examples

Three short examples. Each one shows the code and what it prints.

Example 1 — Show the last editor

Print who last edited the post.

WordPress
<p>Last edited by <?php the_modified_author(); ?></p>

How It Works

  1. the_modified_author() prints the display name of the last editor.
  2. The text before it is ours.
  3. It uses the profile name of the user.

Example 2 — Author and editor

Show the author and the last editor.

WordPress
<p>
  Written by <?php the_author(); ?>.
  Updated by <?php the_modified_author(); ?>.
</p>

How It Works

  1. the_author() prints the original author.
  2. the_modified_author() prints the last editor.
  3. The two names can differ.

Example 3 — Print only when it exists

Use the return function and check first.

WordPress
<?php
$editor = get_the_modified_author();
if ( $editor ) {
  echo '<p>Updated by ' . esc_html( $editor ) . '</p>';
}

How It Works

  1. get_the_modified_author() returns the name, or an empty value.
  2. The if hides the line when there is no name.
  3. esc_html() keeps it safe.

Frequently Asked Questions

It prints the display name of the user who last edited the post.
the_author() prints the original author. the_modified_author() prints the last editor.
No.
Use get_the_modified_author().
The post may never have been edited after it was created.

Browse all post functions

Open the functions index for simple guides with examples and FAQs.

Post Functions Index →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

15 people found this page helpful