تقسيم النتائج على عدة صفحات باستخدام الترميزَين rel="next" وrel="prev"
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
الخميس 15 أيلول (سبتمبر) 2011
مثلما يمكنك استخدام العلامة rel="canonical"
كتلميح قوي على أن المحتوى مكرّر، يمكنك الآن استخدام عناصر رابط HTML
rel="next" وrel="prev"
للإشارة إلى العلاقة بين عناوين URL للمكوّنات في سلسلة مقسّمة على صفحات. على مختلف المواقع الإلكترونية، قد تتخذ
سلسلة من المحتوى مقسّمة على صفحات عدة أشكال، فيمكن أن تكون عبارة عن مقالة مقسّمة إلى عدة صفحات مكوّنات أو فئة منتج مع عناصر منتشرة على عدة صفحات أو سلسلة محادثات
للمنتدى مقسّمة إلى سلسلة من عناوين URL. وإذا اخترت تضمين الترميزَين rel="next" وrel="prev" في صفحات المكوّنات ضمن سلسلة، هذا يعني أنّك تقدّم لمحرك بحث Google
تلميحًا قويًا بأنّك تريد ما يلي:
دمج سمات الفهرسة، مثل الروابط، من صفحات المكوّنات/عناوين URL إلى السلسلة
ككل (أي يجب ألا تظل الروابط موزّعة بين الترميزَين page-1.html وpage-2.html وما إلى ذلك، ولكن يجب أن تكون مجمّعة من خلال السلسلة)
توجيه المستخدمين إلى الصفحة/عنوان URL الأكثر صلة، وتكون عادةً الصفحة الأولى من السلسلة
يمكن الآن الإشارة إلى محرك البحث Google بشأن العلاقة بين عناوين URL للمكوّنات في سلسلة من خلال الترميزَين
rel="next" وrel="prev".
هناك استثناء لتنفيذ الترميزَين rel="prev" وrel="next":
إذا كنت تقدّم للمستخدمين، بالإضافة إلى سلسلة المحتوى، صفحة عرض الكل أو إذا كنت تفكر في تقديمها، اطّلِع على المشاركة الخاصة بنا بشأن
عرض الكل في نتائج البحث للحصول على مزيد من
المعلومات. وبما أنّ المستخدمين يفضّلون استخدام صفحات عرض الكل، نبذل قصارى جهدنا
لعرض هذا الإصدار عندما يكون ذلك مناسبًا في النتائج بدلاً من عرض صفحة مكوّن (يتم عرض صفحات
المكوّنات على الأرجح من خلال الترميزَين rel="next" وrel="prev").
إذا لم يكن لديك صفحة عرض الكل أو أردت منع Google من عرضها، يمكنك
استخدام الترميزَين rel="next" وrel="prev" كما هو موضّح في هذه المشاركة.
للحصول على معلومات عن عمليات إعداد التقسيم على صفحات التي تتضمن صفحة عرض الكل، يُرجى الاطّلاع على منشورنا بشأن
عرض الكل في نتائج البحث.
تحديد خياراتك
إليك ثلاثة خيارات لسلسلة:
يمكنك الإبقاء على المحتوى الخاص بك كما هو بالضبط. يتوفّر المحتوى المقسّم على صفحات على الويب وسنواصل
تقديم أفضل النتائج للمستخدمين بغض النظر عن
ترميز HTML rel="next"/rel="prev" للصفحة وما إذا كان متوفرًا أم لا.
يمكنك إرسال تلميح إلى محرّك البحث Google بشأن العلاقة بين عناوين URL للمكوّنات الخاصة بسلسلتك باستخدام الترميزَين
rel="next" وrel="prev". يساعدنا ذلك على فهرسة المحتوى بدقة أكبر
وعرض الصفحة الأكثر ملاءمةً للمستخدمين (أي الصفحة الأولى عادةً). في ما يلي تفاصيل بشأن
عملية التنفيذ.
تنفيذ الترميزَين rel="next" وrel="prev"
إذا كنت تفضّل استخدام الخيار 3 (أعلاه) لموقعك الإلكتروني، لنبدأ. لنفترض أنه يتوفر لديك محتوى
مقسّمًا إلى عناوين URL:
تحتوي الصفحة الأولى على الترميز rel="next" فقط بدون ترميز rel="prev".
يجب أن تكون الصفحات من الصفحة الثانية إلى الصفحة ما قبل الأخيرة مرتبطة بشكل ثنائي بكل من الترميز rel="next"
والترميز rel="prev".
تحتوي الصفحة الأخيرة على ترميز rel="prev" فقط بدون الترميز rel="next".
يمكن أن تكون القيم rel="next" وrel="prev" إما عناوين URL نسبية
أو كاملة (حسب ما تسمح به العلامة <link />). وإذا ضمّنت رابط
<base/> في المستند، سيتم التعامل مع المسارات النسبية وفقًا
للجزء الأساسي من عنوان URL.
يجب تضمين الترميزَين rel="next" وrel="prev" فقط في القسم
<head>، وليس ضمن الجزء <body> من المستند.
نسمح باستخدام rel="previous" كصيغة نصية لروابط rel="prev".
الترميزان rel="next" وrel="previous" من ناحية،
وrel="canonical" من ناحية أخرى، هما مفهومان مستقلان. ويمكن تضمين كلا التعريفَين في الصفحة نفسها. مثلاً،
قد يتضمن العنوان https://www.example.com/article?story=abc&page=2&sessionid=123 ما يلي:
يتم استخدام الترميزَين rel="prev" وrel="next" كتلميح لمحرّك بحث Google وليس كأوامر
مطلقة.
عند إجراء التنفيذ بشكل غير صحيح، مثل حذف الترميز المتوقّع rel="prev" أو
rel="next" في السلسلة، سنواصل فهرسة الصفحات
والاعتماد على أساليبنا الإرشادية لفهم المحتوى.
[null,null,[],[[["\u003cp\u003e\u003ccode\u003erel="next"\u003c/code\u003e and \u003ccode\u003erel="prev"\u003c/code\u003e are HTML attributes used to indicate the relationship between component URLs in a paginated series, such as articles, product categories, or forum threads.\u003c/p\u003e\n"],["\u003cp\u003eThese attributes help Google consolidate indexing properties and direct users to the most relevant page, usually the first page of the series.\u003c/p\u003e\n"],["\u003cp\u003eWhile \u003ccode\u003erel="next"\u003c/code\u003e and \u003ccode\u003erel="prev"\u003c/code\u003e provide strong hints, they are not absolute directives and Google's algorithms might still utilize heuristics for content understanding.\u003c/p\u003e\n"],["\u003cp\u003eFor paginated content with a "view-all" page, refer to the View-all in search results guide as Google prioritizes surfacing these pages in search results.\u003c/p\u003e\n"],["\u003cp\u003eImplementation involves adding \u003ccode\u003e<link rel="next" href="..."/>\u003c/code\u003e and \u003ccode\u003e<link rel="prev" href="..."/>\u003c/code\u003e tags in the \u003ccode\u003e<head>\u003c/code\u003e section of your HTML, ensuring correct linking between pages in the series.\u003c/p\u003e\n"]]],["`rel=\"next\"` and `rel=\"prev\"` HTML link elements indicate relationships between paginated URLs. Implement these to consolidate indexing properties to the entire series and direct users to the most relevant page, typically the first. Pages within a series should link to the next and previous pages, except the first (only `next`) and last (only `prev`). These tags are hints, not commands, and incorrect use will not prevent indexing. Alternatively, a \"view-all\" page is preferred by searchers.\n"],null,["# Pagination with rel=\"next\" and rel=\"prev\"\n\nThursday, September 15, 2011\n| It's been a while since we published this blog post. Some of the information may be outdated (for example, some images may be missing, and some links may not work anymore). `rel=prev/next` is not an indexing signal anymore. Check out our up-to-date [guide to pagination](/search/docs/specialty/ecommerce/pagination-and-incremental-page-loading).\n\n\nMuch like [`rel=\"canonical\"`](/search/blog/2009/02/specify-your-canonical)\nacts a strong hint for duplicate content, you can now use the HTML link elements\n[`rel=\"next\"` and `rel=\"prev\"`](https://www.whatwg.org/specs/web-apps/current-work/multipage/links.html#sequential-link-types)\nto indicate the relationship between component URLs in a paginated series. Throughout the web, a\npaginated series of content may take many shapes---it can be an article divided into several\ncomponent pages, or a product category with items spread across several pages, or a forum thread\ndivided into a sequence of URLs. Now, if you choose to include `rel=\"next\"` and\n`rel=\"prev\"` markup on the component pages within a series, you're giving Google a\nstrong hint that you'd like us to:\n\n- Consolidate indexing properties, such as links, from the component pages/URLs to the series as a whole (that is, links should not remain dispersed between `page-1.html`, `page-2.html`, etc., but be grouped with the sequence).\n- Send users to the most relevant page/URL---typically the first page of the series.\n\nThe relationship between component URLs in a series can now be indicated to Google through `rel=\"next\"` and `rel=\"prev\"`.\n\n\nThere's an exception to the `rel=\"prev\"` and `rel=\"next\"` implementation:\nIf, alongside your series of content, you also offer users a view-all page, or if you're\nconsidering a view-all page, please see our post on\n[View-all in search results](/search/blog/2011/09/view-all-in-search-results) for more\ninformation. Because view-all pages are most commonly preferred by searchers, we do our best to\nsurface this version when appropriate in results rather than a component page (component pages are\nmore likely to surface with `rel=\"next\"` and `rel=\"prev\"`).\n\n\nIf you don't have a view-all page or you'd like to override Google returning a view-all page, you\ncan use `rel=\"next\"` and `rel=\"prev\"` as described in this post.\nFor information on paginated configurations that include a view-all page, please see our post on [View-all in search results](/search/blog/2011/09/view-all-in-search-results).\n\nOutlining your options\n----------------------\n\n\nHere are three options for a series:\n\n1. Leave whatever you have exactly as-is. Paginated content exists throughout the web and we'll continue to strive to give searchers the best result, regardless of the page's `rel=\"next\"`/`rel=\"prev\"` HTML markup---or lack thereof.\n2. If you have a view-all page, or are considering a view-all page, see our post on [View-all in search results](/search/blog/2011/09/view-all-in-search-results).\n3. Hint to Google the relationship between the component URLs of your series with `rel=\"next\"` and `rel=\"prev\"`. This helps us more accurately index your content and serve to users the most relevant page (commonly the first page). Implementation details below.\n\nImplementing `rel=\"next\"` and `rel=\"prev\"`\n------------------------------------------\n\n\nIf you prefer option 3 (above) for your site, let's get started! Let's say you have content\npaginated into the URLs: \n\n```\nhttps://www.example.com/article?story=abc&page=1\nhttps://www.example.com/article?story=abc&page=2\nhttps://www.example.com/article?story=abc&page=3\nhttps://www.example.com/article?story=abc&page=4\n```\n\n\nOn the first page, `https://www.example.com/article?story=abc&page=1`, you'd include\nin the `\u003chead\u003e` section: \n\n```\n\u003clink rel=\"next\" href=\"https://www.example.com/article?story=abc&page=2\" /\u003e\n```\n\n\nOn the second page, `https://www.example.com/article?story=abc&page=2`: \n\n```\n\u003clink rel=\"prev\" href=\"https://www.example.com/article?story=abc&page=1\" /\u003e\n\u003clink rel=\"next\" href=\"https://www.example.com/article?story=abc&page=3\" /\u003e\n```\n\n\nOn the third page, `https://www.example.com/article?story=abc&page=3`: \n\n```\n\u003clink rel=\"prev\" href=\"https://www.example.com/article?story=abc&page=2\" /\u003e\n\u003clink rel=\"next\" href=\"https://www.example.com/article?story=abc&page=4\" /\u003e\n```\n\n\nAnd on the last page, `https://www.example.com/article?story=abc&page=4`: \n\n```\n\u003clink rel=\"prev\" href=\"https://www.example.com/article?story=abc&page=3\" /\u003e\n```\n\nA few points to mention:\n\n- The first page only contains `rel=\"next\"` and no `rel=\"prev\"` markup.\n- Pages two to the second-to-last page should be doubly-linked with both `rel=\"next\"` and `rel=\"prev\"` markup.\n- The last page only contains markup for `rel=\"prev\"`, not `rel=\"next\"`.\n- `rel=\"next\"` and `rel=\"prev\"` values can be either relative or absolute URLs (as allowed by the `\u003clink /\u003e` tag). And, if you include a `\u003cbase/\u003e` link in your document, relative paths will resolve according to the base URL.\n- `rel=\"next\"` and `rel=\"prev\"` only need to be declared within the `\u003chead\u003e` section, not within the document `\u003cbody\u003e`.\n- We allow `rel=\"previous\"` as a syntactic variant of `rel=\"prev\"` links.\n- `rel=\"next\"` and `rel=\"previous\"` on the one hand and `rel=\"canonical\"` on the other constitute independent concepts. Both declarations can be included in the same page. For example, `https://www.example.com/article?story=abc&page=2&sessionid=123` may contain: \n\n ```\n \u003clink rel=\"canonical\" href=\"https://www.example.com/article?story=abc&page=2\" /\u003e\n \u003clink rel=\"prev\" href=\"https://www.example.com/article?story=abc&page=1&sessionid=123\" /\u003e\n \u003clink rel=\"next\" href=\"https://www.example.com/article?story=abc&page=3&sessionid=123\" /\u003e\n ```\n- `rel=\"prev\"` and `rel=\"next\"` act as hints to Google, not absolute commands.\n- When implemented incorrectly, such as omitting an expected `rel=\"prev\"` or `rel=\"next\"` designation in the series, we'll continue to index the page(s), and rely on our own heuristics to understand your content.\n\n\nMore information can be found in our\n[Help Center](https://support.google.com/webmasters), or join the\nconversation in our\n[Webmaster Help Forum](https://support.google.com/webmasters/community)!\n\n\nWritten by Benjia Li and Joachim Kupke, Software Engineers, Indexing Team"]]