<p><code>profile.cpEditUrl</code> is what you're looking for.</p>

CC BY-SA 4.0
2019-09-19T08:11:47.030Z
So easy, thank you!
Jamie Wade
CC BY-SA 4.0
2019-09-18T16:05:55.517Z
2019-09-18T16:05:55.517Z
dmatthams
<p>Assuming I am fetching an entry like so:</p>

<p><code>{% set profile = craft.entries.id(8268).one %}</code></p>

<p>What is the easiest way to generate a link that allows you to edit that entry in Craft? I know you can do the following:</p>

<p><code>{{ siteUrl ~ 'admin/entries/profiles/' ~ profile.id }}</code></p>

<p>But surely there must be a better way?</p>

<templating>
What's the easiest way to generate a link to edit a given entry in Craft?
# What's the easiest way to generate a link to edit a given entry in Craft?

(Asked by: username_0 on 2019-09-18)

Assuming I am fetching an entry like so:

`{% set profile = craft.entries.id(8268).one %}`

What is the easiest way to generate a link that allows you to edit that entry in Craft? I know you can do the following:

`{{ siteUrl ~ 'admin/entries/profiles/' ~ profile.id }}`

But surely there must be a better way?

**Tags:** templating


---

## 1 answers

### Answer by username_1 on 2019-09-18. Score: 2 | Accepted answer

`profile.cpEditUrl` is what you're looking for.

> **Comments:**
> **username_0**: So easy, thank you!  

---

