-
Indunil
I use Rank math as SEO plugin.
I need to show author URL in structured data. I can do this using Rankmath. But it shows author archives without any content. I need to add content to that author URL like static page.
So I created same URL structure using pages and added contents. Then switch off the author from the Rankmath plugin. Then it does not show in the structured data.
I need to show this (static page) URL structure in the structured data.
What are the solution for this?
-
Hi there,
Sorry I don’t understand the question.
The permalink side of things is all handled by WP core’s Permalink settings and the theme does not have any control over them:
https://wordpress.org/documentation/article/settings-permalinks-screen/I would recommend checking with RankMath’s support team to see how this would be handled when using a Twenty series WP theme then the same method would apply to GP.
Let me know if I’m missing something here 🙂
-
Indunil
Hi sorry for the inconvenience.
I will simply explain this.
I need to add content to the author archive because it is not customizable. Is there a way to do it GP?
Hope you get this…
Thank you.
-
Hi there,
for most archive pages, you can use a GP Block Element Loop Template to replace the themes Loop with your own static content…. but archives, such as the author archive that have no posts will return a No Results status code, so they are not easy to replace.
So, breaking down the issue into two parts:
1. Update all author links to lead to your static author page
This can be done with some PHP, here is an example:add_filter( 'author_link', 'switch_author_links', 10, 2); function switch_author_links( $url, $user_id) { switch($user_id) { case "100": return home_url( 'author_slug_1'); break; case "200": return home_url( 'author_slug_2'); break; case "300": return home_url( 'author_slug_3'); break; } return $url; }
Each case contains an author ID followed by the revised page slug.
For example author with ID of100
gets redirect tomysite.com/author_slug_1
Add as many case clauses as you have author and update the ID and slugs accordingly.
2. Update your RankMath schema.
This is something that RankMath would need to advise one.
It may be they too use theauthor_link
function and the above code will update that too. But I cannot say for certain
- You must be logged in to reply to this topic.