Hello,
Thank you so much for getting in touch.
You could change the Date Format by going to your WordPress Dashboard > Settings > General and using a custom Date Format like M d, Y
to input the abbreviated month. Like this:
https://prnt.sc/f6zu-_r2zMzQ
More on that here:
https://rankmath.com/blog/change-date-and-time-format/
Here’s a documentation by WordPress regarding this matter as well:
https://wordpress.org/documentation/article/customize-date-and-time-format/
Hope that helps and please do not hesitate to let us know if you need my assistance with anything else.
Thanks Marlow for your reply,
But I am specifically talking about this (%currentmonth%) where we dynamically add month in the SEO post/page title!!!
Your given resolution will only change the date format on wordpess site!!
Please check this screenshot
https://snipboard.io/wfNhH0.jpg
Hello,
Thank you for that clarification.
Unfortunately, the functionality of the existing variables like %currentmonth%
cannot be modified.
However, to achieve the structure you have described, then you can create a custom variable using this filter and use it instead:
add_action('rank_math/vars/register_extra_replacements', function () {
rank_math_register_var_replacement(
'currentmonth_short',
[
'name' => esc_html__('Current Month Short form', 'rank-math'),
'description' => esc_html__('Current month in 3 letter format', 'rank-math'),
'variable' => 'currentmonth_short',
'example' => currentmonth_short_callback(),
],
'currentmonth_short_callback'
);
});
function currentmonth_short_callback()
{
$date = date('M', time());
return $date;
}
After applying the code, you can use the variable %currentmonth_short%
.
Here’s how you can add a filter/hook to your WordPress site:
https://rankmath.com/kb/wordpress-hooks-actions-filters/
Hope that helps.
Hello,
Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.
If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.
Thank you.