{"id":23309,"date":"2024-03-31T09:17:58","date_gmt":"2024-03-31T09:17:58","guid":{"rendered":"https:\/\/afreeurl.com\/?p=23309"},"modified":"2024-03-31T09:18:00","modified_gmt":"2024-03-31T09:18:00","slug":"how-do-meta-tags-and-common-seo-facts-work-in-app-router-by-tushar-patel-march-2024","status":"publish","type":"post","link":"https:\/\/afreeurl.com\/?p=23309","title":{"rendered":"How do meta tags and common SEO facts work in app router?  |  by Tushar Patel |  March, 2024"},"content":{"rendered":"<p><img alt=\"\" class=\"bg lr mx c\" width=\"700\" height=\"368\" loading=\"eager\" role=\"presentation\"\/>meta tags in the application router<strong class=\"ne gu\">Page Titles:<\/strong> Each page should have a unique and descriptive title using the <a class=\"af oh\" href=\"https:\/\/nextjs.org\/docs\/pages\/api-reference\/components\/head\" rel=\"noopener ugc nofollow\" target=\"_blank\"><strong class=\"ne gu\"><Head><\/strong><\/a>    component provided by Next.js.  Include relevant keywords in the title to improve search engine visibility.<span id=\"913a\" class=\"oq or gt og b bf os ot l ou ov\">\/\/ application router<\/p>\n<p>import head from &#8220;next\/head&#8221;;<\/p>\n<p>function MyPage() {<br \/>come back (<br \/><><br \/><Head><br \/><title>Title of my page<\/title><br \/><meta name=\"description\" content=\"This is a description of my page.\" \/><br \/><\/Head><\/p>\n<div>{\/* Page content *\/}<\/div>\n<p><\/><br \/>);<br \/>}<\/p>\n<p>export MyPage by default;<\/p>\n<p><\/span><\/p>\n<p id=\"ae47\" class=\"pw-post-body-paragraph nc nd gt ne b nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu nv nw nx ny nz gm bj\"><strong class=\"ne gu\">2. Meta descriptions:<\/strong> Include a concise and <a class=\"af oh\" href=\"https:\/\/nextjs.org\/docs\/app\/building-your-application\/optimizing\/metadata\" rel=\"noopener ugc nofollow\" target=\"_blank\"><strong class=\"ne gu\">compelling meta description<\/strong><\/a>    for each page, as it may appear in search engine results.  While meta descriptions don&#8217;t directly affect rankings, they can affect click-through rates.<\/p>\n<p id=\"485a\" class=\"pw-post-body-paragraph nc nd gt ne b nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu nv nw nx ny nz gm bj\"><strong class=\"ne gu\">3. Structured data:<\/strong> use<strong class=\"ne gu\"> <\/strong><a class=\"af oh\" href=\"https:\/\/stackoverflow.com\/questions\/59318263\/how-can-i-use-application-ldjson-in-nextjs\" rel=\"noopener ugc nofollow\" target=\"_blank\"><strong class=\"ne gu\">JSON-LD <\/strong><\/a>or other structured data formats to mark up your content, helping search engines understand the context of your pages.  This can improve the display of rich snippets in search results.<\/p>\n<p><span id=\"1181\" class=\"oq or gt og b bf os ot l ou ov\">import head from &#8220;next\/head&#8221;;<\/p>\n<p>function MyPage() {<br \/>const structuredData = {<br \/>&#8220;@context&#8221;: &#8220;https:\/\/schema.org&#8221;,<br \/>&#8220;@type&#8221;: &#8220;Organization&#8221;,<br \/>&#8220;url&#8221;: &#8220;https:\/\/www.example.com&#8221;,<br \/>&#8220;name&#8221;: &#8220;Example Organization&#8221;<br \/>};<\/p>\n<p>come back (<br \/><><br \/><Head><br \/><script type=\"application\/ld+json\">{JSON.stringify(structuredData)}<\/script><br \/><\/Head><\/p>\n<div>{\/* Page content *\/}<\/div>\n<p><\/><br \/>);<br \/>}<\/p>\n<p>export MyPage default;<\/p>\n<p><\/span><\/p>\n<p id=\"c077\" class=\"pw-post-body-paragraph nc nd gt ne b nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu nv nw nx ny nz gm bj\"><strong class=\"ne gu\">4. Canonical URLs<\/strong>: Specify the <a class=\"af oh\" href=\"https:\/\/nextjs.org\/learn-pages-router\/seo\/crawling-and-indexing\/canonical\" rel=\"noopener ugc nofollow\" target=\"_blank\"><strong class=\"ne gu\">Canonical URL<\/strong><\/a>    so that each page indicates the preferred version of the page to search engines, especially for pages with similar or duplicate content.<\/p>\n<p><span id=\"5162\" class=\"oq or gt og b bf os ot l ou ov\">import head from &#8220;next\/head&#8221;;<\/p>\n<p>function MyPage() {<br \/>come back (<br \/><><br \/><Head><link rel=\"canonical\" href=\"https:\/\/www.example.com\/my-page\" \/><\/Head><\/p>\n<div>{\/* Page content *\/}<\/div>\n<p><\/><br \/>);<br \/>}<\/p>\n<p>export MyPage by default;<\/p>\n<p><\/span><\/p>\n<p id=\"e24c\" class=\"pw-post-body-paragraph nc nd gt ne b nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu nv nw nx ny nz gm bj\"><strong class=\"ne gu\">5. Internal link<\/strong>: Use internal links to connect related pages within your site.  This helps search engines discover and index your content more efficiently.<\/p>\n<p><span id=\"8fb0\" class=\"oq or gt og b bf os ot l ou ov\">import link from &#8220;next\/link&#8221;;<\/p>\n<p>function MyPage() {<br \/>come back (<\/p>\n<div><Link href=\"\/another-page\"><br \/><a>Link to another page<\/a><br \/><\/Link><\/div>\n<p>);<br \/>}<\/p>\n<p>export MyPage default;<\/p>\n<p><\/span><\/p>\n<p id=\"ed98\" class=\"pw-post-body-paragraph nc nd gt ne b nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu nv nw nx ny nz gm bj\"><strong class=\"ne gu\">6. Image optimization<\/strong>: <a class=\"af oh\" href=\"https:\/\/nextjs.org\/docs\/pages\/building-your-application\/optimizing\/images\" rel=\"noopener ugc nofollow\" target=\"_blank\"><strong class=\"ne gu\">Optimize images <\/strong><\/a>for size and include descriptive alt text to improve accessibility and provide additional context to search engines.<\/p>\n<p><span id=\"af01\" class=\"oq or gt og b bf os ot l ou ov\">import image from &#8220;next\/image&#8221;;<\/p>\n<p>function MyPage() {<br \/>come back (<\/p>\n<div><Image src=\"\/image.jpg\" alt=\"Description of Image\" width={500} height={300} \/><\/div>\n<p>);<br \/>}<\/p>\n<p>export MyPage by default;<\/p>\n<p><\/span><\/p>\n<p id=\"f82f\" class=\"pw-post-body-paragraph nc nd gt ne b nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu nv nw nx ny nz gm bj\"><strong class=\"ne gu\">7. Mobile response:<\/strong> Make sure your site is mobile friendly, as mobile usability is a ranking factor for search engines like Google.<\/p>\n<p id=\"1154\" class=\"pw-post-body-paragraph nc nd gt ne b nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu nv nw nx ny nz gm bj\"><strong class=\"ne gu\">8. Page Speed:<\/strong> improve <a class=\"af oh\" href=\"https:\/\/nextjs.org\/learn-pages-router\/seo\/monitor\/nextjs-speed-insights\" rel=\"noopener ugc nofollow\" target=\"_blank\"><strong class=\"ne gu\">page speed<\/strong><\/a>    optimizing your code, using efficient hosting, and taking advantage of Next.js features like automatic code splitting and image optimization.<\/p>\n<p id=\"a3d0\" class=\"pw-post-body-paragraph nc nd gt ne b nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu nv nw nx ny nz gm bj\"><strong class=\"ne gu\">9. Robots.txt and Sitemap.xml<\/strong>: Use a robots.txt file to control which pages search engines can crawl and index, and submit a sitemap.xml file to help search engines discover and understand your site structure.<\/p>\n<p id=\"75be\" class=\"pw-post-body-paragraph nc nd gt ne b nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu nv nw nx ny nz gm bj\">As with the page router, you can create a static or dynamic  robots.txt sitemap.  Both involve creating a file in the root of your project:<\/p>\n<p>static (<strong class=\"ne gu\">sitemap.xml<\/strong> || <strong class=\"ne gu\">robots.txt<\/strong>)dynamic (<strong class=\"ne gu\">site map.ts<\/strong> || <strong class=\"ne gu\">robots.ts<\/strong>)<\/p>\n<p id=\"7407\" class=\"pw-post-body-paragraph nc nd gt ne b nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu nv nw nx ny nz gm bj\"><strong class=\"ne gu\">10. Monitor performance<\/strong>: Regularly monitor your site&#8217;s performance with tools like Google Search Console and Google Analytics to identify and resolve SEO issues.<\/p>\n<p>[ad_2]<br \/>\n<br \/><a href=\"https:\/\/medium.com\/@tushar.tmpatel\/how-do-meta-tags-and-common-seo-facts-in-the-app-router-defe15a531cd?responsesOpen=true&amp;sortBy=REVERSE_CHRON\" target=\"_blank\" rel=\"noopener\">Source link <\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>meta tags in the application routerPage Titles: Each page should have a unique and descriptive title using the component provided by Next.js. Include relevant keywords in the title to improve search engine visibility.\/\/ application router import head from &#8220;next\/head&#8221;; function MyPage() {come back (Title of my page {\/* Page content *\/} );} export MyPage by default; 2. Meta descriptions: Include a concise and compelling meta description for each page, as it may appear in search&#8230; <\/p>\n","protected":false},"author":1,"featured_media":22471,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-23309","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-seo-news"],"_links":{"self":[{"href":"https:\/\/afreeurl.com\/index.php?rest_route=\/wp\/v2\/posts\/23309","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/afreeurl.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/afreeurl.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/afreeurl.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/afreeurl.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=23309"}],"version-history":[{"count":1,"href":"https:\/\/afreeurl.com\/index.php?rest_route=\/wp\/v2\/posts\/23309\/revisions"}],"predecessor-version":[{"id":23310,"href":"https:\/\/afreeurl.com\/index.php?rest_route=\/wp\/v2\/posts\/23309\/revisions\/23310"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/afreeurl.com\/index.php?rest_route=\/wp\/v2\/media\/22471"}],"wp:attachment":[{"href":"https:\/\/afreeurl.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=23309"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afreeurl.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=23309"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afreeurl.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=23309"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}