Title: the_permalink() returns wrong string
Last modified: August 19, 2016

---

# the_permalink() returns wrong string

 *  [overseastudent](https://wordpress.org/support/users/overseastudent/)
 * (@overseastudent)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/the_permalink-returns-wrong-string/)
 * I have a search.php program which taking care search result.
    The statement of“
   <?php the_permalink() ?>” always returns an error string value, [http://overseastudent.ca/%3Fp%3D5257](http://overseastudent.ca/%3Fp%3D5257)
   rather than [http://overseastudent.ca/?p=5257](http://overseastudent.ca/?p=5257)
 * It was fine before. Can some experts tell me what is going on?
    Thanks in advance.

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Thread Starter [overseastudent](https://wordpress.org/support/users/overseastudent/)
 * (@overseastudent)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/the_permalink-returns-wrong-string/#post-1705841)
 * There is such thing urldecode() ?
 *  Thread Starter [overseastudent](https://wordpress.org/support/users/overseastudent/)
 * (@overseastudent)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/the_permalink-returns-wrong-string/#post-1705862)
 * The question is not challenge enough? why it is ignored. I am waiting online 
   to see the answers…
 *  Thread Starter [overseastudent](https://wordpress.org/support/users/overseastudent/)
 * (@overseastudent)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/the_permalink-returns-wrong-string/#post-1705902)
 * I tried workaround solutions, non of them works, the string is unreplaceable,
   why?
 * 1)
    <?php $source = array(“%3F”, “%3D”); $target = array(“?”, “=”); $content 
   = urldecode(str_replace($source, $target, urlencode(the_permalink()))); echo 
   $content; ?> ” rel=”bookmark” title=”Permanent Link to <?php the_title(); ?>”
   > <?php the_title(); ?> </h2>
 * 2)
    href=”<?php str_replace(“%3Fp%3D”, “?p=”, the_permalink()); ?>” rel=”bookmark”
   title=”<?php the_title(); ?>”
 *  Thread Starter [overseastudent](https://wordpress.org/support/users/overseastudent/)
 * (@overseastudent)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/the_permalink-returns-wrong-string/#post-1705942)
 * looking for straight answer, where is my hero?

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘the_permalink() returns wrong string’ is closed to new replies.

## Tags

 * [the_permalink](https://wordpress.org/support/topic-tag/the_permalink/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 1 participant
 * Last reply from: [overseastudent](https://wordpress.org/support/users/overseastudent/)
 * Last activity: [15 years, 8 months ago](https://wordpress.org/support/topic/the_permalink-returns-wrong-string/#post-1705942)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
