<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: How To Automatically Update Dynamic Year In WordPress Post Titles	</title>
	<atom:link href="https://davidsandyofficial.com/how-to-automatically-update-dynamic-year-in-wordpress-post-titles/feed/" rel="self" type="application/rss+xml" />
	<link>https://davidsandyofficial.com/how-to-automatically-update-dynamic-year-in-wordpress-post-titles/</link>
	<description>Digital Marketing Redefined</description>
	<lastBuildDate>Thu, 26 Nov 2020 17:33:36 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.1</generator>
	<item>
		<title>
		By: Adi		</title>
		<link>https://davidsandyofficial.com/how-to-automatically-update-dynamic-year-in-wordpress-post-titles/#comments/2000179</link>

		<dc:creator><![CDATA[Adi]]></dc:creator>
		<pubDate></pubDate>
		<guid isPermaLink="false">https://davidsandyofficial.com/?p=507701#comment-2000179</guid>

					<description><![CDATA[I have successfully used it in the meta description, but og: title, og: description, twitter: title and twitter: description still show the shortcode. how to solve this problem. thanks]]></description>
			<content:encoded><![CDATA[<p>I have successfully used it in the meta description, but og: title, og: description, twitter: title and twitter: description still show the shortcode. how to solve this problem. thanks</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: David Sandy		</title>
		<link>https://davidsandyofficial.com/how-to-automatically-update-dynamic-year-in-wordpress-post-titles/#comments/2000164</link>

		<dc:creator><![CDATA[David Sandy]]></dc:creator>
		<pubDate></pubDate>
		<guid isPermaLink="false">https://davidsandyofficial.com/?p=507701#comment-2000164</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://davidsandyofficial.com/how-to-automatically-update-dynamic-year-in-wordpress-post-titles/#comments/2000163&quot;&gt;JL&lt;/a&gt;.

You need to have two slashes in the first line for it to be a comment. Try copying and pasting the code again.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://davidsandyofficial.com/how-to-automatically-update-dynamic-year-in-wordpress-post-titles/#comments/2000163">JL</a>.</p>
<p>You need to have two slashes in the first line for it to be a comment. Try copying and pasting the code again.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: JL		</title>
		<link>https://davidsandyofficial.com/how-to-automatically-update-dynamic-year-in-wordpress-post-titles/#comments/2000163</link>

		<dc:creator><![CDATA[JL]]></dc:creator>
		<pubDate></pubDate>
		<guid isPermaLink="false">https://davidsandyofficial.com/?p=507701#comment-2000163</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://davidsandyofficial.com/how-to-automatically-update-dynamic-year-in-wordpress-post-titles/#comments/2000148&quot;&gt;David Sandy&lt;/a&gt;.

I tried the code that you gave for Rank Math, but it still doesn&#039;t work for my blog post titles. :S

This is the code I added in the functions.php file:
/* Shortcode to display the current year in WordPress
//* shortcode: [year]
add_shortcode( &#039;year&#039; , &#039;current_year&#039; );
function current_year() {
$year = date(&quot;Y&quot;);
return &quot;$year&quot;;
}
add_filter( ‘the_title’, ‘do_shortcode’ ); // activate shortcode in WP Title
add_filter( ‘rank_math/frontend/title’, ‘do_shortcode’ ); // activate shortcode in Rank Math Title
add_filter( ‘rank_math/frontend/description’, ‘do_shortcode’ ); //activate shortcode in Rank Math Meta Description

For my blog post title, I wrote &quot;The Best XXXXX in [year]&quot;. However, on the front end, it was shown as &quot;The Best XXXXX in [year]&quot; instead of &quot;The Best XXXXX in 2020&quot;, which is why I&#039;ve changed back the blog post title to &quot;The Best XXXXX&quot; for now.

Do you have any idea what could have gone wrong?]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://davidsandyofficial.com/how-to-automatically-update-dynamic-year-in-wordpress-post-titles/#comments/2000148">David Sandy</a>.</p>
<p>I tried the code that you gave for Rank Math, but it still doesn&#8217;t work for my blog post titles. :S</p>
<p>This is the code I added in the functions.php file:<br />
/* Shortcode to display the current year in WordPress<br />
//* shortcode: [year]<br />
add_shortcode( &#8216;year&#8217; , &#8216;current_year&#8217; );<br />
function current_year() {<br />
$year = date(&#8220;Y&#8221;);<br />
return &#8220;$year&#8221;;<br />
}<br />
add_filter( ‘the_title’, ‘do_shortcode’ ); // activate shortcode in WP Title<br />
add_filter( ‘rank_math/frontend/title’, ‘do_shortcode’ ); // activate shortcode in Rank Math Title<br />
add_filter( ‘rank_math/frontend/description’, ‘do_shortcode’ ); //activate shortcode in Rank Math Meta Description</p>
<p>For my blog post title, I wrote &#8220;The Best XXXXX in [year]&#8220;. However, on the front end, it was shown as &#8220;The Best XXXXX in [year]&#8221; instead of &#8220;The Best XXXXX in 2020&#8221;, which is why I&#8217;ve changed back the blog post title to &#8220;The Best XXXXX&#8221; for now.</p>
<p>Do you have any idea what could have gone wrong?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: David Sandy		</title>
		<link>https://davidsandyofficial.com/how-to-automatically-update-dynamic-year-in-wordpress-post-titles/#comments/2000148</link>

		<dc:creator><![CDATA[David Sandy]]></dc:creator>
		<pubDate></pubDate>
		<guid isPermaLink="false">https://davidsandyofficial.com/?p=507701#comment-2000148</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://davidsandyofficial.com/how-to-automatically-update-dynamic-year-in-wordpress-post-titles/#comments/2000147&quot;&gt;GaryP&lt;/a&gt;.

By using the code, you can use the shortcode anywhere in your post or page across your site.  The Rank Math variables (%currentyear% and %currentmonth%) only work in the title and meta description from what I understand.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://davidsandyofficial.com/how-to-automatically-update-dynamic-year-in-wordpress-post-titles/#comments/2000147">GaryP</a>.</p>
<p>By using the code, you can use the shortcode anywhere in your post or page across your site.  The Rank Math variables (%currentyear% and %currentmonth%) only work in the title and meta description from what I understand.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: GaryP		</title>
		<link>https://davidsandyofficial.com/how-to-automatically-update-dynamic-year-in-wordpress-post-titles/#comments/2000147</link>

		<dc:creator><![CDATA[GaryP]]></dc:creator>
		<pubDate></pubDate>
		<guid isPermaLink="false">https://davidsandyofficial.com/?p=507701#comment-2000147</guid>

					<description><![CDATA[I thought Rank Math came with ability to put variables in form month &#038; year. What does this code add to the built in functionality?  Thanks!]]></description>
			<content:encoded><![CDATA[<p>I thought Rank Math came with ability to put variables in form month &amp; year. What does this code add to the built in functionality?  Thanks!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Evely Navery		</title>
		<link>https://davidsandyofficial.com/how-to-automatically-update-dynamic-year-in-wordpress-post-titles/#comments/2000128</link>

		<dc:creator><![CDATA[Evely Navery]]></dc:creator>
		<pubDate></pubDate>
		<guid isPermaLink="false">https://davidsandyofficial.com/?p=507701#comment-2000128</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://davidsandyofficial.com/how-to-automatically-update-dynamic-year-in-wordpress-post-titles/#comments/2000127&quot;&gt;David Sandy&lt;/a&gt;.

:)]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://davidsandyofficial.com/how-to-automatically-update-dynamic-year-in-wordpress-post-titles/#comments/2000127">David Sandy</a>.</p>
<p>🙂</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: David Sandy		</title>
		<link>https://davidsandyofficial.com/how-to-automatically-update-dynamic-year-in-wordpress-post-titles/#comments/2000127</link>

		<dc:creator><![CDATA[David Sandy]]></dc:creator>
		<pubDate></pubDate>
		<guid isPermaLink="false">https://davidsandyofficial.com/?p=507701#comment-2000127</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://davidsandyofficial.com/how-to-automatically-update-dynamic-year-in-wordpress-post-titles/#comments/2000126&quot;&gt;Evely Navery&lt;/a&gt;.

No problem. Thanks! ?]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://davidsandyofficial.com/how-to-automatically-update-dynamic-year-in-wordpress-post-titles/#comments/2000126">Evely Navery</a>.</p>
<p>No problem. Thanks! ?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Evely Navery		</title>
		<link>https://davidsandyofficial.com/how-to-automatically-update-dynamic-year-in-wordpress-post-titles/#comments/2000126</link>

		<dc:creator><![CDATA[Evely Navery]]></dc:creator>
		<pubDate></pubDate>
		<guid isPermaLink="false">https://davidsandyofficial.com/?p=507701#comment-2000126</guid>

					<description><![CDATA[There is a piece of great information. I use these techniques, and it&#039;s useful for me. Thanks, David, for the great blog. Keep sharing. :)]]></description>
			<content:encoded><![CDATA[<p>There is a piece of great information. I use these techniques, and it&#8217;s useful for me. Thanks, David, for the great blog. Keep sharing. 🙂</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 
Content Delivery Network via davidsandyofficial.b-cdn.net

Served from: davidsandyofficial.com @ 2026-09-19 07:02:36 by W3 Total Cache
-->