WordPress: Neħħi u Idderieġi mill-ġdid Struttura Permalink SSSS / XX / JJ ma 'Regex u Rank Math SEO

Irridirezzjona SSSS / XX / JJ Regex WordPress Rank Matematika SEO

Is-simplifikazzjoni tal-istruttura tal-URL tiegħek hija mod tajjeb ħafna biex ittejjeb is-sit tiegħek għal numru ta 'raġunijiet. URLs twal huma diffiċli biex taqsamhom ma 'oħrajn, jistgħu jinqatgħu f'edituri tat-test u edituri tal-email, u strutturi kumplessi ta' folder tal-URL jistgħu jibagħtu sinjali żbaljati lill-magni tat-tiftix dwar l-importanza tal-kontenut tiegħek.

SSSS / XX / JJ Struttura Permalink

Jekk is-sit tiegħek kellu żewġ URLs, liema waħda taħseb li pprovdiet l-artiklu b'importanza ogħla?

  • https://martech.zone/2013/08/06/yyyy-mm-dd-regex-redirect OR
  • https://martech.zone/yyyy-mm-dd-regex-redirect

One of the default setups for WordPress is to have a permalink structure on the blog that includes the yyyy/mm/dd within the URL. This isn’t ideal for a couple of reasons:

  1. Search Engine Optimization (SEO) – As discussed above, the hierarchy of the site is basically showing search engines that the content is 4 folders away from the home page… so it’s not important content.
  2. Paġna tar-Riżultat tal-Magna tat-Tiftix (SERP) – You may have a fantastic article on your site that you wrote last year but that’s still valid. However, other sites are publishing more recent articles. If you viewed a date structure that was a year ago in the search engine result page (SERP), would you click the older article? Probably not.

L-ewwel pass li għandek tieħu huwa li taġġorna Settings> Permalinks fl-amministratur ta 'WordPress u sempliċement tagħmel il-permalink tiegħek /% postname% /

Settings Permalink ta 'WordPress

This; however, would break all of your existing post links on your blog. After having your blog live for a while, it’s not fun adding redirects for every one of your old articles. That’s okay because you can utilize a Regular Expression (Regex) biex tagħmel dan. Espressjoni regolari tfittex mudell. F'dan il-każ, l-espressjoni regolari tagħna hija:

/\d{4}/\d{2}/\d{2}/(.*)

L-espressjoni ta 'hawn fuq tinqasam kif ġej:

  • / \ d {4} ifittex slash u 4 numri numeriċi li jirrappreżentaw is-sena
  • / \ d {2} ifittex slash u 4 numri numeriċi li jirrappreżentaw ix-xahar
  • / \ d {2} ifittex slash u 4 numri numeriċi li jirrappreżentaw il-ġurnata
  • /(.*) jaqbad dak kollu li jkun fl-aħħar tal-URL f'varjabbli li tista 'tidderieġi lejh. F'dan il-każ:

https://martech.zone/$1

Dan huwa kif jidher fi ħdan il - Rank Matematika SEO plugin (elenkat bħala wieħed minn tagħna plugins tal-WordPress favoriti), just don’t forget to ensure the type is set to Regex bid-dropdown:

jidderieġu seo tal-matematika tal-grad

It-tneħħija tal-Ismijiet tal-Blog, Kategorija, jew Kategorija jew Termini Oħra

It-tneħħija tal-Blog – If you had the term “blog” within your permalink structure, you can utilize Rank Math SEO’s redirections to populate

/blog/([a-zA-Z0-9_.-]+)$

Notice on this, I didn’t use the (.*) option since that would create a loop if I had a page that was just /blog. This requires that there’s some kind of slug after the /blog/. You’ll want to redirect this just as above.

https://martech.zone/$1

It-tneħħija tal-Kategorija - Biex tneħħi kategorija mill - bugħarwien tiegħek (li hemm awtomatikament) ibgħat il - Plugin SEO tal-Matematika tal-Grad li għandu għażla li kategorija ta 'strixxa mill-istruttura tal-URL fis-settings tas-SEO tagħhom> Links:

Ikklassifika l-Kategorija tal-Istrixxa tal-Matematika minn Links

It-tneħħija tal-Kategoriji – If you had categories, you’ll want to be a bit more careful and create an array of the exact category names so you don’t accidentally create a circular loop. Here’s that example:

/(folder1|folder2|folder3)/([a-zA-Z0-9_.-]+)$

Again, I didn’t use the (.*) option since that would create a loop if I had a page that was just /blog. You’ll want to redirect this just as above.

https://martech.zone/$1

Żvelar: Jiena klijent u affiljat ta ' Grad tal-Matematika.

What do you think?

Dan is-sit juża Akismet biex inaqqas l-ispam. Tgħallem kif il-kumment tiegħek huwa pproċessat.