diff --git a/Marlin/src/Marlin.cpp b/Marlin/src/Marlin.cpp
index e20b55ad6fc67b49913725dc14a07ac12b8dfa33..e7e92242f4065137290b9835a51adf3ec7aff714 100644
--- a/Marlin/src/Marlin.cpp
+++ b/Marlin/src/Marlin.cpp
@@ -355,7 +355,6 @@ bool pin_is_protected(const int8_t pin) {
   return false;
 }
 
-#include "gcode/host/M118.h"
 #include "gcode/host/M119.h"
 
 #include "gcode/control/M120_M121.h"
diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp
index b2145675a1596c0e189784be14f35673edc63fd5..3c3f1cd8078e2a650bae9c46674abaab00ffeb9d 100644
--- a/Marlin/src/gcode/gcode.cpp
+++ b/Marlin/src/gcode/gcode.cpp
@@ -116,7 +116,6 @@ void GcodeSuite::dwell(millis_t time) {
 //
 // Placeholders for non-migrated codes
 //
-extern void gcode_M118();
 extern void gcode_M119();
 extern void gcode_M120();
 extern void gcode_M121();
@@ -498,9 +497,8 @@ void GcodeSuite::process_next_command() {
       case 115: M115(); break;    // M115: Report capabilities
 
       case 117: M117(); break;    // M117: Set LCD message text, if possible
-      case 118: // M118: Display a message in the host console
-        gcode_M118();
-        break;
+      case 118: M118(); break;    // M118: Display a message in the host console
+
       case 119: // M119: Report endstop states
         gcode_M119();
         break;
diff --git a/Marlin/src/gcode/host/M118.h b/Marlin/src/gcode/host/M118.cpp
similarity index 95%
rename from Marlin/src/gcode/host/M118.h
rename to Marlin/src/gcode/host/M118.cpp
index 70e8c5f5deb0c62d6946e92fb2dcf31c7e637da2..30a41876f4162f6f581cc91b3a836b4c3ee49b23 100644
--- a/Marlin/src/gcode/host/M118.h
+++ b/Marlin/src/gcode/host/M118.cpp
@@ -20,13 +20,15 @@
  *
  */
 
+#include "../gcode.h"
+
 /**
  * M118: Display a message in the host console.
  *
  *  A  Append '// ' for an action command, as in OctoPrint
  *  E  Have the host 'echo:' the text
  */
-void gcode_M118() {
+void GcodeSuite::M118() {
   if (parser.boolval('E')) SERIAL_ECHO_START();
   if (parser.boolval('A')) SERIAL_ECHOPGM("// ");
   SERIAL_ECHOLN(parser.string_arg);