Чӣ корманд пеш аз он ки ягон чизро сохтан медонад

Ҳар касе метавонад ба як веб- сайт ба як намуна ишора кунад. Ин қоидаҳо барои ҳар як саҳифа истифода мешаванд, чаро ҳар як саҳифа вуҷуд дорад ва кадоме аз онҳо чопро пешгирӣ мекунад, на огоҳӣ.

Ҳар як қоидаи дар поён буда аз рӯи ҳодисае, ки дар сайти мо рух дод, пардохт карда шуд - сангҳои рейтинг, тарҷумаи вайроншуда, саҳифае, ки рамзи сарчашмаи худро нишон медиҳад. Мо дар бораи беҳтарин амалҳо фикр намекунем; мо он чиро, ки аллакай хато буд, навиштаем, то он ки дар сайти шумо низ хато набошад.

Қоидаҳое, ки чопкуниро қатъ мекунанд: 8 бо 12. Саҳифаи маҳдудшуда ба корманд бо сабаб баргардонида мешавад ва аз нав кӯшиш мекунад. Он нашр намешавад ва шуморо баъдтар огоҳ мекунад.

1. One page, one subject

блокҳо чоп кунед

Exactly one <h1>. A descriptive <title> of 15-60 characters.

Чаро: Title is the strongest per-page signal Google has. Google rewrites titles for the SERP most of the time, but the signal it forms from yours still affects ranking, and a generic or duplicated title reads as a quality problem.

2. A description written for a human

огоҳ мекунад

A meta description of 140-158 characters, unique to the page.

Чаро: Description does not rank the page, it decides whether anyone clicks it. Too short wastes the snippet; too long truncates mid-sentence.

3. No shared body text, ever

блокҳо чоп кунед

Every page gets body copy and FAQ answers written for that page. Never a shared template with a noun swapped in.

Чаро: This is the one that costs months. A site we run shipped ~1700 pages on one generic FAQ body and a site-level quality classifier suppressed the whole domain — pages still indexed, ranking gone, no manual action to appeal. Recovery ran on core-update timescale.

4. Absolute canonical, paired with hreflang

блокҳо чоп кунед

Every page self-canonicalises with an absolute URL. Any hreflang cluster ships alongside that canonical, also absolute.

Чаро: Relative hrefs are silently dropped. hreflang without a self-canonical fills the index report with "Duplicate without user-selected canonical" — 56,801 pages on one site we run.

5. Markup may only claim what the page shows

блокҳо чоп кунед

Structured data mirrors the visible text exactly. Schema goes on the page types that earn a rich result, not on everything.

Чаро: Schema is not a general ranking input and not required for AI search -- Google says so directly. Markup that claims a price or a question the page never shows is a violation that can earn a manual action.

6. Django comments are {% comment %}

блокҳо чоп кунед

Never {# #}. Not even on one line.

Чаро: Django's template lexer regex has no DOTALL flag, so {# #} only closes on its own line. A multi-line one renders as visible page text, and if it contains a {% %} substring the lexer treats it as a real tag and every render crashes. Both have happened in production.

7. Positional {0} slots in translatable strings

блокҳо чоп кунед

Any string that will be machine-translated uses {0}, {1} — never {name}.

Чаро: MT engines translate or transliterate the word inside the braces, or drop a brace entirely. A numeric slot has no word to translate and survives intact. This silently broke about 10% of non-English rows on one site before anyone noticed.

8. Nothing is indexable until it is finished

блокҳо чоп кунед

Pages ship noindex. Indexing is a deliberate opt-in by the owner, per site.

Чаро: These sites share a wildcard domain. One spam tenant indexed on that wildcard damages every other tenant on it, and a half-finished page indexed on day one takes months to undo.

9. Build the thing, do not describe the thing

огоҳ мекунад

A page either does something useful or says something specific. A page that only describes a tool is not a page.

Чаро: Thin wrappers around someone else's API are the clearest signal a quality classifier has. Real utility is what survives a core update.

11. Alt text and intrinsic dimensions on every image

огоҳ мекунад

Every <img> has alt text and explicit width/height.

Чаро: Alt text is an accessibility requirement first and an indexing signal second. Missing dimensions cause layout shift, which is a Core Web Vitals failure on mobile — and mobile is what gets indexed.

12. Retired URLs return 410, verified

блокҳо чоп кунед

A removed page returns 410 Gone, confirmed by an actual request after deploy.

Чаро: A 404 lingers as a soft-404 for months; a 410 deindexes cleanly. And per-view dispatch often intercepts the request before the 410-returning view is ever reached, so the check has to be a real HTTP request, not a code read.

Чаро ин linter аст ва на style guide

Қоидае, ки танҳо дар дастури корӣ зиндагӣ мекунад, ин пешниҳод аст - модел ба он пайравӣ мекунад ва бо оҳистаӣ дигарашро иҷро намекунад, ва шумо се моҳ баъд дар гузориши ҳаракатро мефаҳмед. Пас инҳо ҳамчун рамз иҷро мешаванд, баъди навиштани саҳифа ва пеш аз он ки он фаъол шавад. Саҳифае, ки қоидаи блокиро ноком мекунад, бо сабаб баргардонида мешавад ва аз нав навишта мешавад. Натиҷа дар ҳар ду роҳ гирифта мешавад, бинобар ин шумо метавонед бубинед, ки кадом санҷишҳо иҷро шудаанд.

Ва то он даме, ки шумо инро нагӯед, ягон чиз индекс карда намешавад

Ҳар як пойгоҳ noindex- ро оғоз мекунад. Бо нобаёнӣ шумо бояд кашф кунед - ҳамчун қоида linter- ро иҷро мекунад, зеро ин пойгоҳҳо домени муштарак доранд ва як ҳамсояи бад ҳамаро дар он зарар мерасонад. Вақте ки пойгоҳи шумо барои ёфтан арзиш дорад, шумо индексатсияро дар танзимотҳо фаъол мекунед ва он оғози ҷустуҷӯ мешавад.

Иҷрои навбатдории аввал