You can hide or show link from the backend
Stores >> Configuration >> General >> Contacts
You can enable or disable the default link
EDIT
You can do this by observer
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
<event name="admin_system_config_changed_section_YourSectionName">
<observer instance="Namespace\Modulename\Observer\ContactUsLink" name="admin_system_config_changed_section_yoursectionname"/>
</event>
</config>
ContactUsLink.php
<?php
namespace Pkit\JobPortal\Observer;
use Magento\Framework\Event\Observer as EventObserver;
class ContactUsLink implements \Magento\Framework\Event\ObserverInterface {
const XML_PATH_CONTACTUS = 'contact/contact/enabled'; //defualt magento contact us system path
const XML_PATH_YOURCONTACTUS = 'section/group/field'; //your contact us system path
protected $_scopeConfig;
protected $_configInterface;
public function __construct(
\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
\Magento\Framework\App\Config\ConfigResource\ConfigInterface $configInterface
)
{
$this->_scopeConfig = $scopeConfig;
$this->_configInterface = $configInterface;
}
public function execute(EventObserver $observer)
{
if($this->_scopeConfig->getValue(self::XML_PATH_YOURCONTACTUS)){
$this->_configInterface
->saveConfig(self::XML_PATH_CONTACTUS, 0 , 'default', 0);
} else if(!$this->_scopeConfig->getValue(self::XML_PATH_YOURCONTACTUS)){
$this->_configInterface
->saveConfig(self::XML_PATH_CONTACTUS, 1 , 'default', 0);
}
}
}