plugin wp seo yoast - make the url unlimited

i want in wordpress long unlimited with no char limiti use plugin wordpress seowhen i try make url likeit show only ca

i want in wordpress long unlimited with no char limit

i use plugin wordpress seo

when i try make url like

/ it show only can be

/

only 39 char can be make it url

so how we can edit this problem and it have problem with google for long url or its ok?

waiting answer and advice

i want in wordpress long unlimited with no char limit

i use plugin wordpress seo

when i try make url like

https://sitename/برمجة-تصميم-موقع-مركز-رفع-تحميل-تطبيق-تطبيقات-ايفون-اندرويد/ it show only can be

https://sitename/برمجة-تصميم-موقع-مركز-رفع-تحميل-تطبيق-ت/

only 39 char can be make it url

so how we can edit this problem and it have problem with google for long url or its ok?

waiting answer and advice

Share Improve this question edited May 18, 2017 at 22:33 Tom J Nowell 61.2k7 gold badges79 silver badges150 bronze badges asked May 18, 2017 at 21:08 div infodiv info 93 bronze badges
Add a comment  | 

3 Answers 3

Reset to default 4

You might think it's 39 characters long, but it's actually 332 characters long.

This is the real URL you're trying to use:

https://sitename/%D8%A8%D8%B1%D9%85%D8%AC%D8%A9-%D8%AA%D8%B5%D9%85%D9%8A%D9%85-%D9%85%D9%88%D9%82%D8%B9-%D9%85%D8%B1%D9%83%D8%B2-%D8%B1%D9%81%D8%B9-%D8%AA%D8%AD%D9%85%D9%8A%D9%84-%D8%AA%D8%B7%D8%A8%D9%8A%D9%82-%D8%AA%D8%B7%D8%A8%D9%8A%D9%82%D8%A7%D8%AA-%D8%A7%D9%8A%D9%81%D9%88%D9%86-%D8%A7%D9%86%D8%AF%D8%B1%D9%88%D9%8A%D8%AF/

But Those Aren't Arabic Characters?!

There's no such thing as a true Arabic URL. HTTP requests don't use unicode, and the RFC that determines a valid URL doesn't include non-latin characters.

Then How Do International URLs Work?

Encoding! Each characters UTF value is percent encoded so it fits into the latin character-set. The browser uses this internally but translates for the address bar and tooltips.

So your URL might look like this to you:

https://sitename/برمجة-تصميم-موقع-مركز-رفع-تحميل-تطبيق-ت/

But it's actually:

https://sitename/%D8%A8%D8%B1%D9%85%D8%AC%D8%A9-%D8%AA%D8%B5%D9%85%D9%8A%D9%85-%D9%85%D9%88%D9%82%D8%B9-%D9%85%D8%B1%D9%83%D8%B2-%D8%B1%D9%81%D8%B9-%D8%AA%D8%AD%D9%85%D9%8A%D9%84-%D8%AA%D8%B7%D8%A8%D9%8A%D9%82-%D8%AA/

Each percent, e.g. %D8, represents a code for a non-english character. This is equivalent to UTF-8 prior to percent encoding. The browser hides this by displaying the decoded character in its UI so that you can read it, rather than showing the ugly percent encoded version it's really using.

So What's the Maximum URL Length?

The spec doesn't give a maximum, but software might place limits. If it does there's a HTTP code that indicates the URL is too long.

But what about WordPress?

What's The Maximum Post Slug Length?

This will be determined by the size of the column in the posts table. At the time of writing, the post_name column is varchar(200), putting the limit at 200 characters.

Arabic and international post names will be longer than they are written, so multiply the length by 3, which gives a maximum of 66 characters

Can I Increase This Number?

Yes... ish, but at great risk. You can use SQL to manually increase the column size from 200 to a higher value, but when updating WordPress and doing other table operations, WordPress may resize the column back to 200 characters during an upgrade. This would truncate and break all your post slugs and URLs.

Only do this if you're comfortable modifying WordPress Core for every update and security fix. There is no guarantee that WordPress will even use the extra space. If you intend to go down this route, it will be expensive, time consuming, and very easy to break.

Is This Hurting My SEO?

No, Google etc know about this, and handle it fine. But if it did hurt your SEO, it'd hurt every other Arabic site just as much.

WordPress SEO will be counting the characters of the encoded version, not the human readable decoded version, so ignore it and file a bug report with the plugin author

Alternatives

You can back this ticket that's trying to bump the max from 200 to 400 in a future version of WordPress:

https://core.trac.wordpress/ticket/10483

The problem the plugin is reporting doesn't exist. As Tom pointed out the URL contains more bytes than 39, but not more characters.

The part after the domain name is encoded in UTF-8, and every search engine knows how to handle that. That's why you will be found when someone is searching for a word that is part of your visible URL. Punycode is used to encode domain names with non-ASCII characters. That doesn't affect you at all.

Ignore the plugin "warning". It's the result of a bug in that plugin, because it is counting bytes, not characters.

Try to add these lines to your theme's functions.php file:

// First of all lets remove standard hook
remove_filter('sanitize_title', 'sanitize_title_with_dashes');

// Add our custom hook for sanitize_title method
add_filter('sanitize_title', 'custom_sanitize_title_with_dashes', 10, 3);

/**
  * Sanitizes a title, replacing whitespace and a few other characters with dashes.
  *
  * Limits the output to alphanumeric characters, underscore (_) and dash (-).
  * Whitespace becomes a dash.
  *
  * @since 1.2.0
  *
  * @param string $title The title to be sanitized.
  * @param string $raw_title Optional. Not used.
  * @param string $context Optional. The operation for which the string is sanitized.
  * @return string The sanitized title.
  */

function custom_sanitize_title_with_dashes($title, $raw_title = '', $context = 'display') {
  $title = strip_tags($title);

  // Preserve escaped octets.
  $title = preg_replace('|%([a-fA-F0-9][a-fA-F0-9])|', '---$1---', $title);

  // Remove percent signs that are not part of an octet.
  $title = str_replace('%', '', $title);

  // Restore octets.
  $title = preg_replace('|---([a-fA-F0-9][a-fA-F0-9])---|', '%$1', $title);

  if (seems_utf8($title)) {
    if (function_exists('mb_strtolower')) {
      $title = mb_strtolower($title, 'UTF-8');
    }
    $title = utf8_uri_encode($title, 3000);
  }

  $title = strtolower($title);

  if ( 'save' == $context ) {
    // Convert nbsp, ndash and mdash to hyphens
    $title = str_replace( array( '%c2%a0', '%e2%80%93', '%e2%80%94' ), '-', $title );

    // Convert nbsp, ndash and mdash HTML entities to hyphens
    $title = str_replace( array( ' ', ' ', '–', '–', '—', '—' ), '-', $title );

    // Convert forward slash to hyphen
    $title = str_replace( '/', '-', $title );

    // Strip these characters entirely
    $title = str_replace( array(

      // iexcl and iquest
      '%c2%a1', '%c2%bf',

      // angle quotes
      '%c2%ab', '%c2%bb', '%e2%80%b9', '%e2%80%ba',

      // curly quotes

      '%e2%80%98', '%e2%80%99', '%e2%80%9c', '%e2%80%9d',
      '%e2%80%9a', '%e2%80%9b', '%e2%80%9e', '%e2%80%9f',

      // copy, reg, deg, hellip and trade
      '%c2%a9', '%c2%ae', '%c2%b0', '%e2%80%a6', '%e2%84%a2',

      // acute accents
      '%c2%b4', '%cb%8a', '%cc%81', '%cd%81',

      // grave accent, macron, caron
      '%cc%80', '%cc%84', '%cc%8c',
    ), '', $title );

    // Convert times to x
    $title = str_replace( '%c3%97', 'x', $title );
  }

  $title = preg_replace('/&.+?;/', '', $title); // kill entities
  $title = str_replace('.', '-', $title);
  $title = preg_replace('/[^%a-z0-9 _-]/', '', $title);
  $title = preg_replace('/\s+/', '-', $title);
  $title = preg_replace('|-+|', '-', $title);
  $title = trim($title, '-');

  return $title;
}

Or try this plugin: Longer Permalinks.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744986948a4604667.html

相关推荐

  • plugin wp seo yoast - make the url unlimited

    i want in wordpress long unlimited with no char limiti use plugin wordpress seowhen i try make url likeit show only ca

    1天前
    40

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信