Disable autocomplete entity reference field In my page content type, I've created an entity reference field that references another page content. When entering data into the entity reference field, it does a search of all the content on the site and returns a list of it. I want to be able to just enter in the node ID, instead of making it search for it. 

Currently, you cannot just put in the node ID, as it will throw an error about content not existing.

Is there a way to just input just the node ID? Is there a special format?
There are a couple of options on how to do this.

1) switch the field settings reference method from "default" to "view", and create an entity reference view where the label is the nid

2) create a field widget plugin based on  EntityReferenceAutocompleteWidget.php in your custom module, and replace the form element 

'#type' =&gt; 'entity_autocomplete',


with a text field.

 '#type' =&gt; 'textfield',


Below is a custom widget that does this.

Most of the changes are within the formElement method, but I added some validation to check if the entity is a valid entity of the correct type within the allowed bundles.

namespace Drupal\mymodule\Plugin\Field\FieldWidget;

use Drupal\Core\Field\FieldItemListInterface;
use Drupal\Core\Field\WidgetBase;
use Drupal\Core\Form\FormStateInterface;
use Symfony\Component\Validator\ConstraintViolationInterface;

/**
 * Plugin implementation of the 'entity_reference_textfield' widget.
 *
 * @FieldWidget(
 *   id = "entity_reference_textfield",
 *   label = @Translation("Textfield"),
 *   description = @Translation("A text field for entity reference"),
 *   field_types = {
 *     "entity_reference"
 *   }
 * )
 */
class EntityReferenceTextField extends WidgetBase  {

  /**
   * {@inheritdoc}
   */
  public static function defaultSettings() {
    return array(
      'size' =&gt; '60',
      'placeholder' =&gt; '',
    ) + parent::defaultSettings();
  }

  /**
   * {@inheritdoc}
   */
  public function settingsForm(array $form, FormStateInterface $form_state) {
    $element['size'] = array(
      '#type' =&gt; 'number',
      '#title' =&gt; t('Size of textfield'),
      '#default_value' =&gt; $this-&gt;getSetting('size'),
      '#min' =&gt; 1,
      '#required' =&gt; TRUE,
    );
    $element['placeholder'] = array(
      '#type' =&gt; 'textfield',
      '#title' =&gt; t('Placeholder'),
      '#default_value' =&gt; $this-&gt;getSetting('placeholder'),
      '#description' =&gt; t('Text that will be shown inside the field until a value is entered. This hint is usually a sample value or a brief description of the expected format.'),
    );
    return $element;
  }

  /**
   * {@inheritdoc}
   */
  public function settingsSummary() {
    $summary = array();

    $operators = $this-&gt;getMatchOperatorOptions();
    $summary[] = t('Textfield size: @size', array('@size' =&gt; $this-&gt;getSetting('size')));
    $placeholder = $this-&gt;getSetting('placeholder');
    if (!empty($placeholder)) {
      $summary[] = t('Placeholder: @placeholder', array('@placeholder' =&gt; $placeholder));
    }
    else {
      $summary[] = t('No placeholder');
    }

    return $summary;
  }

  /**
   * {@inheritdoc}
   */
  public function formElement(FieldItemListInterface $items, $delta, array $element, array &amp;$form, FormStateInterface $form_state) {

    $values = $items-&gt;getValue();

    $element += array(
      '#type' =&gt; 'textfield',
      '#default_value' =&gt; isset($values[$delta]) ? $values[$delta]['target_id'] : NULL,
      '#size' =&gt; $this-&gt;getSetting('size'),
      '#placeholder' =&gt; $this-&gt;getSetting('placeholder'),
    );

    return array('target_id' =&gt; $element);
  }


  /**
   * {@inheritdoc}
   */
  public function errorElement(array $element, ConstraintViolationInterface $error, array $form, FormStateInterface $form_state) {

    if (empty($element['target_id'])) {
      return FALSE;
    }

    // Do some validation, to make sure this a real entity within
    // the list of allowed bundles.

    $settings = $this-&gt;getFieldSettings();

    $storage = \Drupal::entityTypeManager()-&gt;getStorage($settings['target_type']);

    $entity = $storage-&gt;load($element['target_id']['#value']);

    if (!empty($entity) &amp;&amp; in_array($entity-&gt;bundle(), $settings['handler_settings']['target_bundles'])) {
      return $element['target_id'];
    }
    else {
      $form_state-&gt;setError($element['target_id'], t('This is not a valid entity reference id.'));
    }

    return FALSE;
  }

}