Programmatically create new entry with saveElement I am currently trying to save a new entry with craft()-&gt;elements-&gt;saveElement(), as I want to avoid triggering the onBeforeSave and onAfterSave events.

When I run my script, it returns a successful entry id, but there is no entry in the admin.

Here is my code:

$entry = new EntryModel();
$entry-&gt;sectionId = $sectionId;
$entry-&gt;typeId = $entryTypeId;
$entry-&gt;enabled = true;
$entry-&gt;authorId = 1;

$success = craft()-&gt;elements-&gt;saveElement($entry, false);

if ($success) {
    echo $entry-&gt;id;
}
In Craft's v3 API documentation they give an example:

https://docs.craftcms.com/api/v3/craft-services-elements.html#method-saveelement

$entry = new Entry();
$entry-&gt;sectionId = 10;
$entry-&gt;typeId = 1;
$entry-&gt;authorId = 5;
$entry-&gt;enabled = true;
$entry-&gt;title = "Hello World!";
$entry-&gt;setFieldValues([
    'body' =&gt; "&lt;p&gt;I can’t believe I literally just called this “Hello World!”.&lt;/p&gt;",
]);
$success = Craft::$app-&gt;elements-&gt;saveElement($entry);
if (!$success) {
    Craft::error('Couldn’t save the entry "'.$entry-&gt;title.'"', __METHOD__);
}