| 开发者 | MENJ |
|---|---|
| 更新时间 | 2026年3月10日 21:18 |
| 捐献地址: | 去捐款 |
| PHP版本: | 8.2 及以上 |
| WordPress版本: | 6.9 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
guest-author custom field key also works for programmatic or WP-CLI workflows.
This plugin was inspired by a tutorial from WPBeginner.
Features
Author name override
John Doe, Jane Smith).A, B and C), Comma (A, B, C), Ampersand (A & B & C).the_author filter) and block/FSE themes (via get_the_author_display_name filter).author property from JSON-LD schema output.wpseo_schema_graph filter) and Rank Math (rank_math/schema/article filter).ms_MY)..pot template file.custom-guest-authors folder to /wp-content/plugins/.By default, the override applies to Posts only. To enable it for Pages or any registered custom post type, go to Settings › Guest Authors › General and check the post types you want. All public post types registered on your site are listed.
Edit any post of an enabled type. A Guest Authors panel appears in the right-hand sidebar — in the Document panel for the block editor, or as a meta box in the classic editor. Enter one or more names separated by commas and save the post.
Enter names separated by commas in the Guest Authors field, e.g. Zamri Vinoth, Firdaus Wong, Ali Hassan. The display format is controlled by the Join Style setting on the Display tab: Natural (Zamri Vinoth, Firdaus Wong and Ali Hassan), Comma (Zamri Vinoth, Firdaus Wong, Ali Hassan), or Ampersand (Zamri Vinoth & Firdaus Wong & Ali Hassan).
Yes. Go to Settings › Guest Authors › General and enter a name in the Fallback Guest Author Name field. This name is shown on any post of an enabled type that has no per-post guest author set. Leave it blank to fall back to the WordPress post author on those posts.
Yes. The plugin hooks both the_author (used by classic themes) and get_the_author_display_name (the dynamic filter used by block themes via get_the_author_meta( 'display_name' )). This covers all Twenty Twenty-One through Twenty Twenty-Five themes and all FSE themes that use the core/post-author or core/post-author-name blocks.
Yes, provided the page builder reads the author via the_author(), get_the_author(), or get_the_author_meta( 'display_name' ). This covers Elementor, Beaver Builder, Divi, WPBakery, Kadence, Astra, and GeneratePress, among others.
Yes. The meta key is guest-author. You can set it via the raw Custom Fields panel (if enabled), programmatically with update_post_meta(), or via WP-CLI. The editor panel is a convenience wrapper over the same key.
By default, yes — the override applies everywhere the author name is displayed. To restrict it to single post pages only, go to Settings › Guest Authors › Display and set Show Override On to Single posts only.
When a guest author is active on a post, the author archive URL is automatically suppressed. Guest authors are not WordPress users and have no author archive. The author name is displayed as plain unlinked text.
Not by default. If you want to remove the author property from JSON-LD schema output, enable the Suppress author from JSON-LD schema toggle on the Advanced tab. This works with both Yoast SEO and Rank Math.
The plugin caches author names per post using WordPress transients. The cache is cleared automatically whenever a post is saved. If you are updating meta programmatically (e.g. via WP-CLI or a migration script), the cache is also cleared on any added_post_meta, updated_post_meta, or deleted_post_meta action. If names are still stale, go to Settings › Guest Authors › Debug and click Clear Cache to flush all cached entries immediately.
The default cache lifetime is 12 hours. You can change this from 1 to 168 hours under Settings › Guest Authors › Advanced. The cache is always invalidated immediately on post save regardless of the TTL.
No. Deleting the plugin via the WordPress Plugins screen runs uninstall.php, which removes all plugin options (cga_default_guest_author, cga_enabled_post_types, cga_join_style, cga_apply_on, cga_cache_ttl, cga_suppress_schema, cga_cache_version) and all cga_* transients from the database.
Yes. The Debug tab at Settings › Guest Authors › Debug runs a live diagnostics check on the server: it verifies that filter hooks are registered, checks whether the guest-author meta is set on the most recent published post, confirms that the post type is in the enabled list, tests whether custom-fields support is declared (required for Gutenberg meta writes), and simulates the filter output. A manual post-ID tester lets you check any specific post by ID. A Clear Cache button is also available.
Open Settings › Guest Authors › Debug and look at the diagnostics table. Confirm that both the_author and get_the_author_display_name filters show as registered. Confirm that the post type is listed as enabled and that custom-fields support is shown as active. If the post type does not support custom fields, the Gutenberg panel will accept input but silently discard it on save — enabling the post type on the General tab corrects this automatically.
Yes, for the optional schema suppression feature. When Suppress author from JSON-LD schema is enabled on the Advanced tab, the plugin removes the author property from Article-type schema nodes via wpseo_schema_graph (Yoast SEO) and rank_math/schema/article (Rank Math). The author name override itself works independently of any SEO plugin.
Yes. All strings are wrapped in WordPress i18n functions. A Malay (Malaysia) translation (ms_MY) is bundled. A .pot template file is included for community translations.
& or < were displaying as garbled code (e.g. &) on some themes.ms_MY locale.