I want to retrieve the content of a page via ajax. but i have a problem with get_permalink
<?php
$id = 171;
$post = get_post($id);
?>
<a class="post-link" rel="" href="<?php echo get_permalink($id); ?>">
when I echo the permalink it gives me this address
https://mysite/2018/11/24/152-revision-v1
If I click in the link it gives me a page not found. If I copy paste it in the url a page not found shows. I verify the guid in the database and is the same that permalink gives me. When I watch a page in the address bar in chrome only shows me https://mysite/mypage/
Other thing I had notice in the database is that the post id change every time the page content is edited, how I can search for the id of page if it always change?