简体   繁体   中英

how to control guid url in wordpress

My title is kadhal-rojave-roja-2 but the guid id is http://sample.com/kadhal-rojave-roja-2/ . I need it without dashes, like this:

http://sample.com/kadhal rojave roja 2/

How to do it?

This is my post code:

  $new_post = array(
      'ID' => '',
      'post_author' => $user->ID, 

      'post_excerpt' => $excerpt,
      'post_title' => $post_title,
      'post_status' => 'publish',

    );
$post_id = wp_insert_post($new_post);

This isn't possible, a browser will encode the spaces as %20 instead even if you do find a way to do this. Google also recommends using underscores or hyphens instead of spaces and so it is much better for search engine optimisation.

Also a URL could be much longer if you use %20 as it is 3 characters rather than 1.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM